dsaeyrq451928 2018-10-04 08:29
浏览 57
已采纳

gometalinter正在检查/ usr / local / go文件

I'm running gometalinter against one file: gometalinter ./src/main.go

but it prints errors for golang source files:

90cc5ff9b2ea:/repo# gometalinter ./src/main.go 
../usr/local/go/src/net/lookup_unix.go:80:24:warning: unused struct field undeclared name: cgoLookupHost (structcheck)
../usr/local/go/src/net/lookup_unix.go:323:23:warning: undeclared name: cgoLookupPTR (interfacer)
../usr/local/go/src/net/lookup_unix.go:323:23:warning: error return value not checked (undeclared name: cgoLookupPTR) (errcheck)
../usr/local/go/src/net/lookup_unix.go:95:24:warning: error return value not checked (undeclared name: cgoLookupIP) (errcheck)
../usr/local/go/src/net/lookup_unix.go:80:24:warning: error return value not checked (undeclared name: cgoLookupHost) (errcheck)
../usr/local/go/src/net/lookup_unix.go:123:24:warning: unused struct field undeclared name: cgoLookupCNAME (structcheck)
../usr/local/go/src/net/lookup_unix.go:323:23:warning: unused variable or constant undeclared name: cgoLookupPTR (varcheck)
../usr/local/go/src/net/lookup_unix.go:80:24:warning: unused variable or constant undeclared name: cgoLookupHost (varcheck)
../usr/local/go/src/net/lookup_unix.go:95:24:warning: undeclared name: cgoLookupIP (interfacer)
../usr/local/go/src/net/lookup_unix.go:80:24:warning: undeclared name: cgoLookupHost (interfacer)
../usr/local/go/src/net/lookup_unix.go:95:24:warning: unused variable or constant undeclared name: cgoLookupIP (varcheck)
../usr/local/go/src/net/lookup_unix.go:107:23:warning: error return value not checked (undeclared name: cgoLookupPort) (errcheck)
../usr/local/go/src/net/lookup_unix.go:323:23:warning: unused struct field undeclared name: cgoLookupPTR (structcheck)
../usr/local/go/src/net/lookup_unix.go:107:23:warning: unused struct field undeclared name: cgoLookupPort (structcheck)
../usr/local/go/src/net/lookup_unix.go:123:24:warning: unused variable or constant undeclared name: cgoLookupCNAME (varcheck)
../usr/local/go/src/net/lookup_unix.go:123:24:warning: undeclared name: cgoLookupCNAME (interfacer)
../usr/local/go/src/net/lookup_unix.go:123:24:warning: error return value not checked (undeclared name: cgoLookupCNAME) (errcheck)
../usr/local/go/src/net/lookup_unix.go:95:24:warning: unused struct field undeclared name: cgoLookupIP (structcheck)
../usr/local/go/src/net/lookup_unix.go:107:23:warning: unused variable or constant undeclared name: cgoLookupPort (varcheck)
../usr/local/go/src/net/lookup_unix.go:107:23:warning: undeclared name: cgoLookupPort (interfacer)

How to run gometalinter agains one file or against ./src directory only?

My config:

{
  "Deadline": "5m",
  "EnableGC": true,
  "Enable": [
    "deadcode",
    "gocyclo",
    "gofmt",
    "gotype",
    "goimports",
    "golint",
    "gosimple",
    "ineffassign",
    "interfacer",
    "misspell",
    "unconvert",
    "unused",
    "vet",
    "varcheck",
    "maligned",
    "errcheck",
    "megacheck",
    "goconst",
    "structcheck"
  ],
  "Cyclo": 10,
  "Aggregate": true
}

This command is started in Docker container based on golang:alpine as root user.

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 ansys fluent计算闪退
  • ¥15 有关wireshark抓包的问题
  • ¥15 需要写计算过程,不要写代码,求解答,数据都在图上
  • ¥15 向数据表用newid方式插入GUID问题
  • ¥15 multisim电路设计
  • ¥20 用keil,写代码解决两个问题,用库函数
  • ¥50 ID中开关量采样信号通道、以及程序流程的设计
  • ¥15 U-Mamba/nnunetv2固定随机数种子
  • ¥15 vba使用jmail发送邮件正文里面怎么加图片
  • ¥15 vb6.0如何向数据库中添加自动生成的字段数据。