Categorygithub.com/barandemirbas/open-with
repositorypackage
0.0.0-20210224131034-34a907a3cdeb
Repository: https://github.com/barandemirbas/open-with.git
Documentation: pkg.go.dev

# README

Go Report Card Go Reference

Getting Started

Install Open With

go get -u github.com/barandemirbas/open-with

Add to your imports to start using Open With

import "github.com/barandemirbas/open-with"

Functions

Browser function opens a new browser tab for pointing url with default browser.

openwith.Browser("https://github.com/barandemirbas/open-with")
openwith.Browser("127.0.0.1", 8000) // http://127.0.0.1:8000
openwith.Browser("127.0.0.1/path", 8000) // http://127.0.0.1:8000/path 

Examples

Example with Browser function:

package main

import (
	"github.com/barandemirbas/open-with"
	"net/http"
)

type HttpHandler struct{}

func (h HttpHandler) ServeHTTP(res http.ResponseWriter, req *http.Request) {
	res.Write([]byte("Hello World!"))
}

func main() {
	openwith.Browser("127.0.0.1", 8000)
	http.ListenAndServe(":8000", HttpHandler{})
}