项目作者: gostaticanalysis

项目描述 :
Analyzer: called is a analyzer which can find function calling
高级语言: Go
项目地址: git://github.com/gostaticanalysis/called.git
创建时间: 2020-01-18T11:06:37Z
项目社区:https://github.com/gostaticanalysis/called

开源协议:MIT License

下载


called

pkg.go.dev

called finds calls specified by the called.funcs flag.

  1. package main
  2. import "log"
  3. func main() {
  4. log.Fatal("hoge")
  5. }
  1. $ go vet -vettool=`which called` -called.funcs="log.Fatal" main.go
  2. ./main.go:6:11: log.Fatal must not be called

Ignore Checks

Analyzers ignore nodes annotated with staticcheck’s style comments as below.
An ignore comment includes the analyzer names and a reason for disabling the check.
If you specify called as an analyzer name, all analyzers ignore the corresponding code.

  1. package main
  2. import "log"
  3. func main() {
  4. //lint:ignore called reason
  5. log.Fatal("hoge")
  6. }

Release

This repository uses tagpr to automatically create release pull requests when
changes are merged to the main branch. The current version is stored in the
VERSION file and TagPR reads settings from .tagpr.