• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Staticcheck: Staticcheck 是一个开源的 Go 语言静态代码分析工具

原作者: [db:作者] 来自: 网络 收藏 邀请

Staticcheck logo
The advanced Go linter

Staticcheck is a state of the art linter for the Go programminglanguage. Using static analysis, it finds bugs and performance issues,offers simplifications, and enforces style rules.

Financial support by private and corporate sponsors guarantees the tool's continued development.Please become a sponsor if you or your company rely on Staticcheck.

Documentation

You can find extensive documentation on Staticcheck on its website.

Installation

Releases

It is recommended that you run released versions of the tools. Thesereleases can be found as git tags (e.g. 2019.1) as well as prebuiltbinaries in the releases tab.

The easiest way of using the releases from source is to use a Gopackage manager such as Godep or Go modules. Alternatively you can usea combination of git clone -b and go get to check out theappropriate tag and download its dependencies.

Master

You can also run the master branch instead of a release. Note thatwhile the master branch is usually stable, it may still contain newchecks or backwards incompatible changes that break your build. Byusing the master branch you agree to become a beta tester.

Tools

All of the following tools can be found in the cmd/ directory. Eachtool is accompanied by its own README, describing it in more detail.

ToolDescription
keyifyTransforms an unkeyed struct literal into a keyed one.
staticcheckGo static analysis, detecting bugs, performance issues, and much more.
structlayoutDisplays the layout (field sizes and padding) of structs.
structlayout-optimizeReorders struct fields to minimize the amount of padding.
structlayout-prettyFormats the output of structlayout with ASCII art.

Libraries

In addition to the aforementioned tools, this repository contains thelibraries necessary to implement these tools.

Unless otherwise noted, none of these libraries have stable APIs.Their main purpose is to aid the implementation of the tools. If youdecide to use these libraries, please vendor them and expect regularbackwards-incompatible changes.

System requirements

We support the last two versions of Go.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap