Skip to Content
marmot
DiagnosticsError codes
example $ marmot build .
error[M0005]: "os" imported and not used
 --> ./main.go:3:8
  |
3 | import "os" // nothing uses os
  |        ^^^^ imported here but not used
  |
  = help: if it is imported only for its side effects, write `import _ "os"`

error: build failed with 1 error
for more about an error, run `marmot explain M0005`
The program that produced it
package main

import "os" // nothing uses os

func main() {}

The mistake and the fix

The mistake
import "os" // nothing uses os
Fixed
// remove the import, or for side effects only:
import _ "net/http/pprof"

The fix

Remove the import, or use _ as its name if it is imported only for its init side effects.

See also all error codes and marmot explain.

On this page

Was this page helpful?

Report an issueOpen issues