github.com/gophergala2016/cmd-go-js@v0.0.0-20160421080227-24a7748a7d62/samples/hello-world/main.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"go/build"
     6  	"runtime"
     7  )
     8  
     9  func main() {
    10  	fmt.Printf("Hello brave new world! It is working on %v %v/%v!", runtime.Version(), build.Default.GOOS, build.Default.GOARCH)
    11  	if build.Default.GOARCH == "js" {
    12  		fmt.Print(" That means you can execute it in browsers.")
    13  	}
    14  	fmt.Println()
    15  }