4

I try go1.16

import "embed"

I get

> golangci-lint run ./...
> Can't run linter goanalysis_metalinter: bodyclose: failed prerequisites ... could not import embed

how skip file/package in golangci-lint?

batazor
  • 852
  • 2
  • 16
  • 36

1 Answers1

7

Using a config file

You can customize the behavior with a config file. Docs are here https://golangci-lint.run/usage/configuration/. Make a .golangci.yml file that looks like this:

run:
  skip-files:
    - main.go

//nolint

You can add //nolint to the top of the file.

//nolint
package foo

See https://golangci-lint.run/usage/false-positives/

Steven Masley
  • 634
  • 2
  • 9
  • 1
    I think the problem may be related to these issues: - [1466](https://github.com/golangci/golangci-lint/issues/1466) - [913](https://github.com/golangci/golangci-lint/issues/913) – batazor Feb 01 '21 at 02:36
  • Ah, I see. Yea, I just ran my solution with a pkg does not exist, and it does not ignore it properly. – Steven Masley Feb 01 '21 at 02:38