Files
opentf/internal/command/webbrowser/native.go
Mikel Olasagasti Uranga a7b48eec51 Use github.com/cli/browser (#602)
Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
2024-01-03 11:32:55 -05:00

22 lines
495 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package webbrowser
import (
"github.com/cli/browser"
)
// NewNativeLauncher creates and returns a Launcher that will attempt to interact
// with the browser-launching mechanisms of the operating system where the
// program is currently running.
func NewNativeLauncher() Launcher {
return nativeLauncher{}
}
type nativeLauncher struct{}
func (l nativeLauncher) OpenURL(url string) error {
return browser.OpenURL(url)
}