OpenPeeDeeP / depguard

Go linter that checks if package imports are in a list of acceptable packages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

depguard does not check for "fmt"

kokizzu opened this issue · comments

golangci.yml config:

linters-settings:
  depguard:
    list-type: blacklist
    include-go-root: false
    packages:
      - github.com/sirupsen/logrus
      - github.com/rs/zerolog
      - fmt

example go file:

package main

import "fmt"

func main() {
  fmt.Println("test")
}

example run golangci-lint run *.go

Expected result: error
Current result: no error

change include-go-root to true. By default (which is false) it ignores imports from GOROOT because it is assumed safe as it is apart of Go's standard library.