hello-world

This commit is contained in:
Mark McGranaghan 2012-10-03 10:11:45 -07:00
parent 7161bea7b9
commit 67644af21d
2 changed files with 19 additions and 0 deletions

BIN
src/004-hello-world/hello-world Executable file

Binary file not shown.

View File

@ -2,3 +2,22 @@
# use `go run`.
$ 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.
$ go build hello-world.go
$ ls
hello-world hello-world.go
# We can then execute this binary directly.
$ ./hello-world
Hello world
# Now that we can run and build basic Go programs, let's
# learn more about the language.