openskills.info
Go Fundamentals logoCourse Preview

Go Fundamentals

Go is a compiled, strongly typed programming language for building reliable software. It organizes code into packages and includes built-in tools for formatting, testing, dependency management, and concurrency.

itProgramming languages

Go Fundamentals

Go is a general-purpose programming language with a compact syntax and a focused toolchain. You write source files, group them into packages, and group related packages into a module.

Use this mental model:

module → packages → source files → declarations and statements
   ↓         ↓             ↓
go.mod   import path   compiler + Go tools

The language is strongly typed and garbage-collected. It has explicit support for concurrent programming. The standard toolchain builds, formats, tests, documents, and manages dependencies for Go code.

Go is a useful choice when you want a compiled program, direct deployment, clear package boundaries, and concurrency primitives in the language. It does not remove the need to design APIs, synchronize shared state, handle failures, or measure performance.

Start with a module

A module is a collection of related packages released together. Its root contains a go.mod file.

example.com/greeter/
├── go.mod
├── main.go
└── greeting/
    ├── greeting.go
    └── greeting_test.go

The module path is the import-path prefix for its packages. The go command uses it when resolving dependencies.

go mod init example.com/greeter

A package is a collection of source files in one directory that compile together. Every source file begins with a package clause.

package greeting

func Message(name string) string {
	return "Hello, " + name
}

An executable program uses package main and defines func main().

package main

import (
	"fmt"

	"example.com/greeter/greeting"
)

func main() {
	fmt.Println(greeting.Message("Ari"))
}

Continue the course

This section is part of the paid course.

See pricing to subscribe, or log in if you already have access.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources

  • https://go.dev/ref/spec
  • https://go.dev/doc/tutorial/getting-started
  • https://go.dev/doc/code
  • https://go.dev/doc/tutorial/
  • https://go.dev/doc/effective_go
  • https://go.dev/doc/modules/managing-dependencies
  • https://pkg.go.dev/testing
  • https://pkg.go.dev/context
  • https://go.dev/doc/faq
  • https://pkg.go.dev/std
  • https://github.com/sindresorhus/awesome
  • https://github.com/avelino/awesome-go
  • https://golangci-lint.run/docs/
  • https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv.md
  • https://www.goreleaser.com/getting-started/quick-start/