1.4 KiB
-
Run your own program? Say hello to yourself.
-
Build your program using
go build
-
And, send it to your friend (s/he should use be using the same operating system) (if you're using windows, then hers/his should be windows too)
-
And then send your program to a friend with a different operating system.
(So, you should compile your program for her operating system).
For OSX, type: GOOS=darwin GOARCH=386 go build
For Windows: GOOS=windows GOARCH=386 go build
For Linux: GOOS=linux GOARCH=arm GOARM=7 go build
You can find the full list in here: https://golang.org/doc/install/source#environment
-
-
Call Print instead of Println to see what happens.
-
Call Println or Print with multiple values by separating them using commas.
-
Remove double quotes from string literals and see what happens.
-
Move the package and import statement to the bottom of the file and see what happens.
-
Read Go online documentation. Take a quick look at the packages and read what they do. Look at their source-code by clicking on their titles.
You don't have to understand anything, just do it. This will warm you up for the upcoming lectures. https://golang.org/pkg
- Also, take a tour: https://tour.golang.org/ See the language features. We're going to talk all about them soon.