My first time using Go

After following the straightforward installation guide from this page:

https://github.com/golang/go/wiki/Ubuntu

I wrote my first go program this morning. Executing the go build command will build the hello.go and produce the following binary file named with go. I was confused, why there is a new file created named with go, but after I executed the binary file I finally able to see the output in the console.

hello, world

I explored a bit the go build command and I think I can do better by naming the build output file using the -o option.

go build -o hello

So, the binary file will be named to hello instead of go. This is content inside of the binary file.

It's magic, oops, I mean machine code

It’s magic, oops, I mean machine code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s