Tools, FAQ, Tutorials:
Build and Run "Hello" Go Program
How to Build and Run "Hello" Go Program on Ubuntu?
✍: FYIcenter.com
Hyperledger Fabric framework is written in Go language.
So it is important to learn how build and run Go programs on Ubuntu.
Here are the steps to build and run the "Hello" Go program.
1. Make sure that Go is installed.
$ go version go version go1.11.5 linux/amd64
2. Create a Go working directory
$ mkdir go $ export GOPATH=~/go
3. Create hello.go source code file. Remember to use Ctrl-D to end the input of the "cat" command.
$ cd go
$ mkdir src/hello
cat > src/hello/hello.go
package main
import "fmt"
func main() {
fmt.Printf("Hello world!\n")
}
^D
4. Compile and build the executable file.
$ export GOPATH=~/go $ go install hello
5. Run the executable file.
$ bin/hello Hello world!
⇒ Download Hyperledger Fabric Source Code
⇐ Verify Docker Engine on Ubuntu
2020-05-15, ∼1478🔥, 0💬
Popular Posts:
What is Azure API Management Developer Portal? Azure API Management Developer Portal is an Azure Web...
What is EPUB 3.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 3.0 Metadata "dc:publisher" ...
How to create a "Sign-up or Sign-in" user flow policy in my Azure AD B2C directory? If you want to b...
How to build a PHP script to dump Azure AD 2.0 Authentication Response? If you are use the Azure-AD-...
How to read Atom validation errors at w3.org? If your Atom feed has errors, the Atom validator at w3...