Skip to content

Coding Conventions

We are following the Effective Go guidelines for coding conventions. The following is a summary of the most important conventions.

Naming

The following naming conventions are used in the project:

Naming conventions in Go

  • camelCase for variables and functions, which are not exported
  • PascalCase for types and functions that need to be exported

Examples

  • labInstanceStatus: variable name for a status of a lab instance
  • UpdateLabInstanceStatus: name for an exported function, starts with a capital letter

Formatting

We are using the gofmt from the Go standard library to format our code.

staticcheck is used as a linter in addition to the formatting guidelines from Effective Go, because it is the default linter of the Go extension for VS Code.


Last update: June 27, 2023