Skip to content

Instantly share code, notes, and snippets.

View MiniAppleTheApple's full-sized avatar

MiniApple MiniAppleTheApple

  • Brasil RJ Rio de Janeiro
View GitHub Profile
@hyg
hyg / gist:9c4afcd91fe24316cbf0
Created June 19, 2014 09:36
open browser in golang
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@proudlygeek
proudlygeek / cocreteType.go
Created April 28, 2014 10:46
Opaque interfaces in Golang
package opaque
type internalBasicType int
//
// Prevents the interface to be implemented
// *outside* the package, since is lowerCase (thus private).
//
// This is best suited for API and things we don't
// wanna people to override.