hello world
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// ## Hello World
|
||||
|
||||
// Here's an example Go program.
|
||||
// Our first program prints the classic "Hello world"`
|
||||
// message.
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
// It prints `Hello world`.
|
||||
func main() {
|
||||
fmt.Println("Hello world")
|
||||
}
|
||||
|
||||
@@ -3,14 +3,8 @@
|
||||
$ go run hello-world.go
|
||||
Hello world
|
||||
|
||||
# The `go run example.go` approach is a great way to
|
||||
# experiment with Go examples, and we'll use it heavily
|
||||
# throughout this book.
|
||||
|
||||
# Sometimes we'll need to build our sample programs
|
||||
# into stand-alone binaries. We can do this using
|
||||
# `go build`, which will produce a binary based on the
|
||||
# name of the given Go file.
|
||||
# Sometimes we'll want to build our programs into
|
||||
# binaries. We can do this using `go build`.
|
||||
$ go build hello-world.go
|
||||
$ ls
|
||||
hello-world hello-world.go
|
||||
|
||||
Reference in New Issue
Block a user