Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.38 KB

File metadata and controls

28 lines (21 loc) · 1.38 KB

Exercise 1 - Getting Started with Go

If you do not finish during the lecture period, please finish it as homework.

Setup

  • Install Go from https://golang.org or install via a repository manager
  • Test if go can be executed from the command line.
  • Check the Go environment via go env, especially the variable GOPATH. There the external dependencies are installed.
  • Create your Go workspace directory
  • Create a HelloWorld.go
  • Test the HelloWorld program with "go run HelloWorld.go"
  • Compile the HelloWorld program with "go build". You need to init the module first via go mod init HelloWorld. Check the content of the created file go.mod.
  • Optional, but desirable: Install Visual Studio Code, IntelliJ, GoLand or any other Editor with Go support and get familiar with it.
  • Try to run the hello world example code inside https://goplay.tools/ Alternative: https://play.golang.org/ Alternative: https://go-playground-wasm.vercel.app/
  • Learn the basics by understanding the first six examples at https://gobyexample.com/
  • Optional: Get familiar with the community. Look what others have done: https://github.com/avelino/awesome-go

Answer the following question

  • In your opinion, what are the characteristics of a successful language?

After this Exercise

  • You should have a working Go installation on your computer
  • You should know how to compile and run Go code