Jason Buberel | 9385327 | 2015-08-30 13:36:03 -0700 | [diff] [blame] | 1 | An overview of tools that will help improve your Go code |
| 2 | |
Jason Buberel | 042985a | 2015-09-12 14:14:00 -0700 | [diff] [blame] | 3 | ## All-in-one |
| 4 | |
Pascal Vorwerk | 24224e7 | 2019-04-21 14:02:37 +0200 | [diff] [blame] | 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. |
Jason Buberel | 042985a | 2015-09-12 14:14:00 -0700 | [diff] [blame] | 7 | |
Jason Buberel | 9385327 | 2015-08-30 13:36:03 -0700 | [diff] [blame] | 8 | ## Code Formatting |
| 9 | |
Jason Buberel | a3d4690 | 2015-09-13 08:41:30 -0700 | [diff] [blame] | 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 | |
Jason Buberel | 9385327 | 2015-08-30 13:36:03 -0700 | [diff] [blame] | 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 |
xin zhao | c5ec1b8 | 2019-01-03 14:38:56 +0800 | [diff] [blame] | 18 | - [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) - Format code and fix your import statements |
zy | 1b0587a | 2018-11-02 12:34:19 +0800 | [diff] [blame] | 19 | - [revive](https://github.com/mgechev/revive) - Fast, configurable, extensible, flexible, and beautiful linter for Go |
Jason Buberel | 9385327 | 2015-08-30 13:36:03 -0700 | [diff] [blame] | 20 | |
Jason Buberel | 92cc542 | 2015-09-12 15:18:39 -0700 | [diff] [blame] | 21 | ## Code generation, Templating and Generics |
Jason Buberel | 8e66a02 | 2015-09-12 15:12:03 -0700 | [diff] [blame] | 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. |
Jason Buberel | 92cc542 | 2015-09-12 15:18:39 -0700 | [diff] [blame] | 26 | - [gotemplate](https://github.com/ncw/gotemplate) - Package-based templating system for Go |
Jason Buberel | c549bf6 | 2015-09-13 08:22:07 -0700 | [diff] [blame] | 27 | - [sqlgen](https://github.com/drone/sqlgen) - Generate Go code for SQL interactions. |
Martin Czygan | e6eb99c | 2018-11-04 13:36:39 +0100 | [diff] [blame] | 28 | - [zek](https://github.com/miku/zek) - Generate Go struct from XML. |
Jason Buberel | 8e66a02 | 2015-09-12 15:12:03 -0700 | [diff] [blame] | 29 | |
Jason Buberel | 9385327 | 2015-08-30 13:36:03 -0700 | [diff] [blame] | 30 | ## Refactoring |
Jason Buberel | a3d4690 | 2015-09-13 08:41:30 -0700 | [diff] [blame] | 31 | |
| 32 | ### Articles |
| 33 | |
Jason Buberel | 9385327 | 2015-08-30 13:36:03 -0700 | [diff] [blame] | 34 | - [Refactoring with go fmt](http://spf13.com/post/go-fmt/) |
| 35 | - [gorename - easy refactoring](https://texlution.com/post/gorename/) |
Kate Fitzpatrick | eb94b9c | 2018-10-30 09:41:52 -0700 | [diff] [blame] | 36 | - [Refactoring Tools](http://blog.ralch.com/tutorial/golang-tools-refactoring/) - An overview of refactoring tools for Go. |
Jason Buberel | dafb934 | 2015-09-27 14:03:12 -0700 | [diff] [blame] | 37 | - [Quick renaming with gofmt](http://technosophos.com/2015/09/26/quick-go-hack-renaming-structs.html) |
Jason Buberel | a3d4690 | 2015-09-13 08:41:30 -0700 | [diff] [blame] | 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 |
Jason Buberel | 9385327 | 2015-08-30 13:36:03 -0700 | [diff] [blame] | 44 | |
| 45 | ## Error Detection |
| 46 | |
Jason Buberel | a3d4690 | 2015-09-13 08:41:30 -0700 | [diff] [blame] | 47 | ### Articles |
| 48 | |
| 49 | - [Go Inspection Tools](http://blog.ralch.com/tutorial/golang-tools-inspection/) - An overview of tools for Go code inspection. |
Jason Buberel | dafb934 | 2015-09-27 14:03:12 -0700 | [diff] [blame] | 50 | |
Jason Buberel | a3d4690 | 2015-09-13 08:41:30 -0700 | [diff] [blame] | 51 | ### Tools |
| 52 | |
Auke Willem Oosterhoff | ca30732 | 2016-10-17 09:33:48 +0200 | [diff] [blame] | 53 | - [AlignCheck, StructCheck, VarCheck](https://github.com/opennota/check/) - A suite of tools for checking your code. |
Jason Buberel | a3d4690 | 2015-09-13 08:41:30 -0700 | [diff] [blame] | 54 | - [errcheck](https://github.com/kisielk/errcheck) - Ensure you check your error conditions. |
Jason Buberel | 9385327 | 2015-08-30 13:36:03 -0700 | [diff] [blame] | 55 | - [go vet](http://golang.org/cmd/vet/) - Read this first on how to use the `go vet` command. |
Jason Buberel | a3d4690 | 2015-09-13 08:41:30 -0700 | [diff] [blame] | 56 | - [SafeSQL](https://github.com/stripe/safesql) - Protect against unsafe SQL in your code. |
Jason Buberel | 9385327 | 2015-08-30 13:36:03 -0700 | [diff] [blame] | 57 | |
| 58 | ## Navigation |
| 59 | |
Shai Coleman | 11eafc6 | 2018-10-28 23:40:33 +0000 | [diff] [blame] | 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. |
Jason Buberel | 042985a | 2015-09-12 14:14:00 -0700 | [diff] [blame] | 62 | |
| 63 | ## Visualization |
| 64 | |
Karol Marcjan | f533d0e | 2015-09-19 15:53:15 +0200 | [diff] [blame] | 65 | - [godegraph](http://github.com/kisielk/godepgraph) - A tool for generating dependency graphs of Go code. |