github.com/kevinklinger/open_terraform@v1.3.6/noninternal/command/webbrowser/native.go (about)

     1  package webbrowser
     2  
     3  import (
     4  	"github.com/pkg/browser"
     5  )
     6  
     7  // NewNativeLauncher creates and returns a Launcher that will attempt to interact
     8  // with the browser-launching mechanisms of the operating system where the
     9  // program is currently running.
    10  func NewNativeLauncher() Launcher {
    11  	return nativeLauncher{}
    12  }
    13  
    14  type nativeLauncher struct{}
    15  
    16  func (l nativeLauncher) OpenURL(url string) error {
    17  	return browser.OpenURL(url)
    18  }