Resolving of common errors

go.mod file not found

Executing go test results in error: go: go.mod file not found in current directory or any parent directory; see 'go help modules'.

In order to resolve it:

  1. Initialize a new Go module in the working directory:
go mod init <module name>

After executing of the command above, you should see a new go.mod file created in the current directory.

  1. Add module requirements and sums to go.mod file:
go mod tidy