Go programming language tutorials go.dev tutorials
in the order of creation
- Getting started
- Create a module
- Tour of Go
- Getting started with multi-module workspaces
- Accessing relational database
- Developing a RESTful API with Go and Gin
- Getting started with generics
- Getting started with fuzzing
- Writing Web Applications with Go
- Blog : Strings, bytes, runes and characters in Go
ideally, in a legitimate application 1 project would have 1 go.mod
similar to Java, you would have 1 entry point main.go
and import packages to your necessary classes / go files.
Some observations I found :
- each package does not need a separate
go.mod
file. - each package may contain unique variables and functions.
- unlike Java where each class is independent, go files are not independent; go packages are independent.
GoLand IDE will not allow multiple package main
lines in the project.
However, if you still place it and run the following, each file with main
function can run.
go run <path-to-my-file-with-main>