GOPATHas the root of your project, and create a new module with the
go mod initcommand.
go.modfile will be generated, containing the module path, a Go version, and its dependency requirements, which are the other modules needed for a successful build.
go mod initwill try to guess the module path from the directory structure. It can also be overridden by supplying an argument.
go.modfile could look like this:
go fmt. Your editor should be running this on every file save.