Skip to content

Latest commit

 

History

History
129 lines (88 loc) · 4.45 KB

README.md

File metadata and controls

129 lines (88 loc) · 4.45 KB

Golang 开发工具栈

⬅︎ 返回上层

TOC

其他

配置

  • viper: 支持环境变量,配置文件 (JSON, TOML, YAML, HCL, envfile, Java properties config files),命令行参数。

开发必备

DAP

  • delve: a debugger for the Go

Code Generator

  • stringer: String() 方法的代码生成器

Formater

  • goimports: go get golang.org/x/tools/cmd/goimports. 自动化加入 import,或去除 import 里未使用的包。同时也会自动格式化代码,类似 gofmt。
  • gofmt: 格式化代码用

Linter

  • golangci-lint: a Go linters aggregator.
  • golint: Linter,格式固定唯一,无选项。
  • Staticcheck: Using static analysis, it finds bugs and performance issues, offers simplifications, and enforces style rules.
  • revive: ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint

Cheatsheet

Logger

模板引擎

  • sprig: Useful template functions for Go templates
  • gomplate: 虽然不支持 sprig,但提供了等价的丰富的函数库

错误处理

结构化数据处理

JSON

  • gjson: JSON parser for Go

CLI

测试

  • goconvey: Go testing in the browser. Integrates with go test
  • testify: 提供 assert, require, mock, suit 工具函数
  • gomock
  • monkey: Monkey patch。目前只支持 amd64 架构。
  • testaroli: Monkey patch。支持 amd64 和 arm64 架构。

Profiling

HTTP

  • mux: a request router and dispatcher
  • gin: http web 框架

容器

终端 Shell