← 返回命令列表

Linux command

golint 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Lint current package

golint .

Lint specific file

golint [file.go]

Lint package recursively

golint ./...

Set minimum confidence

golint -min_confidence [0.8] ./...

说明

golint checks Go source code for style issues based on the guidelines from Effective Go and the Go Code Review Comments. It focuses on naming conventions, comments, and code structure. Unlike go vet which finds bugs, golint focuses on style and readability. Issues are suggestions, not errors. The tool is deprecated in favor of staticcheck or golangci-lint.

参数

-min_confidence _n_
Minimum confidence for issues (0.0-1.0).
-set_exit_status
Exit with non-zero status on issues.

FAQ

What is the golint command used for?

golint checks Go source code for style issues based on the guidelines from Effective Go and the Go Code Review Comments. It focuses on naming conventions, comments, and code structure. Unlike go vet which finds bugs, golint focuses on style and readability. Issues are suggestions, not errors. The tool is deprecated in favor of staticcheck or golangci-lint.

How do I run a basic golint example?

Run `golint .` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -min_confidence _n_ do in golint?

Minimum confidence for issues (0.0-1.0).