hello-world
This commit is contained in:
parent
7161bea7b9
commit
67644af21d
BIN
src/004-hello-world/hello-world
Executable file
BIN
src/004-hello-world/hello-world
Executable file
Binary file not shown.
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user