Go: 'go: cannot find main module' or 'package X is not in std'
@devsingh05▲ 10 net votes
Go commands run inside a module. In the project folder run go mod init <module-path> (e.g. github.com/you/app) to create go.mod, then go mod tidy to fetch imports. 'package X is not in std' or 'no required module provides package' means the import path does not match go.mod's module path, or the dependency is not added yet (go get X). Run commands from the folder that contains go.mod, or a subfolder of it.