The Simplest Go Example: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Go Engineering =Overview= The simples way to get experimenting with Go code is to install Go and then: * Create a director...")
 
 
(2 intermediate revisions by the same user not shown)
Line 15: Line 15:
}
}
</syntaxhighlight>
</syntaxhighlight>
* Execute with:
<syntaxhighlight lang='bash'>
go run main.go
</syntaxhighlight>
* Open the directory with [[GoLand]] and use it to edit, run and debug it from inside the IDE.

Latest revision as of 20:12, 15 December 2023

Internal

Overview

The simples way to get experimenting with Go code is to install Go and then:

  • Create a directory (gotest).
  • In that directory, create a main.go file with this content:
package main

func main() {
  println(".")
}
  • Execute with:
go run main.go
  • Open the directory with GoLand and use it to edit, run and debug it from inside the IDE.