blob: a35936d2bca557b614d11aa1e43af379ed3c2c85 [file] [log] [blame] [view]
lou-land9955112019-07-22 17:54:13 +08001An overview of tools that will help improve your Go code
2
3## All-in-one
4
5 - [golangci-lint](https://github.com/golangci/golangci-lint) - Bundle of `gofmt`, `golint`, `govet` and many other tools that shares work between the different linters for better performance. Recommended by the original author to replace gometalinter (Drop-in replacement).
6 - DEPRECATED: [gometalinter](https://github.com/alecthomas/gometalinter) - Automates the installation, configuration and application of `gofmt`, `golint`, `govet` and several other code validation tools.
7
8## Code Formatting
9
10### Articles
11
12 - [Formatting Go Code with gofmt](http://golangtutorials.blogspot.com/2011/06/formatting-go-code-with-gofmt.html)
13
14### Tools
15
16 - [gofmt](https://golang.org/cmd/gofmt/) - Start with the standard Go code formatter
17 - [golint](https://github.com/golang/lint) - Detects style mistakes in Go code
18 - [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) - Format code and fix your import statements
19 - [revive](https://github.com/mgechev/revive) - Fast, configurable, extensible, flexible, and beautiful linter for Go
20
21## Code generation, Templating and Generics
22
23 - [json-to-go](https://mholt.github.io/json-to-go/) - Generate Go structs from JSON.
24 - [Go gen](http://clipperhouse.github.io/gen/) - Type-driven code generation (generics)
25 - [gojson](https://github.com/ChimeraCoder/gojson) - Another Go struct generator.
26 - [gotemplate](https://github.com/ncw/gotemplate) - Package-based templating system for Go
27 - [sqlgen](https://github.com/drone/sqlgen) - Generate Go code for SQL interactions.
28 - [zek](https://github.com/miku/zek) - Generate Go struct from XML.
29
30## Refactoring
31
32### Articles
33
34 - [Refactoring with go fmt](http://spf13.com/post/go-fmt/)
35 - [gorename - easy refactoring](https://texlution.com/post/gorename/)
36 - [Refactoring Tools](http://blog.ralch.com/tutorial/golang-tools-refactoring/) - An overview of refactoring tools for Go.
37 - [Quick renaming with gofmt](http://technosophos.com/2015/09/26/quick-go-hack-renaming-structs.html)
38
39### Tools
40
41- [eg](https://godoc.org/golang.org/x/tools/cmd/eg) - Example-based refactoring tool for Go
42- [gofmt](https://golang.org/cmd/gofmt/) - Start with the standard Go code formatter
43- [gorename](https://golang.org/x/tools/refactor/rename) - Renaming tool for Go
44
45## Error Detection
46
47### Articles
48
49 - [Go Inspection Tools](http://blog.ralch.com/tutorial/golang-tools-inspection/) - An overview of tools for Go code inspection.
50
51### Tools
52
53 - [AlignCheck, StructCheck, VarCheck](https://github.com/opennota/check/) - A suite of tools for checking your code.
54 - [errcheck](https://github.com/kisielk/errcheck) - Ensure you check your error conditions.
55 - [go vet](http://golang.org/cmd/vet/) - Read this first on how to use the `go vet` command.
56 - [SafeSQL](https://github.com/stripe/safesql) - Protect against unsafe SQL in your code.
57
58## Navigation
59
60 - [Go Guru - User Manual](https://golang.org/s/using-guru) - A tool for understanding Go code.
61 - [Pythia](https://github.com/fzipp/pythia) - A browser-based UI for Go Guru.
62
63## Visualization
64
65 - [godegraph](http://github.com/kisielk/godepgraph) - A tool for generating dependency graphs of Go code.