Go Error Messages
Compiled language and toolchain from Google.All Go pages
- Go error: "os" imported and not usedGo refuses to compile a file that imports a package it never uses. Delete the import, let goimports or gopls manage imports, or use _ for side-effect imports.
- Go fatal error: all goroutines are asleep - deadlock!Go stops when every goroutine is blocked, typically a send on an unbuffered channel with no receiver. Start the receiver, buffer the channel or close it.
- Go: declared and not used: xGo refuses to compile a function that declares a local variable it never reads. Use the variable, delete it, or assign it to the blank identifier _ to debug.
- go: go.mod file not found in current directory or any parent directory; see 'go help modules'Go needs a go.mod in module mode and found none in this folder or its parents. Run go mod init in the project root, cd into the module, or use go install pkg@v.