Go đi kèm bộ toolchain rất mạnh ngay từ khi cài đặt: go build để compile thành binary, go run để compile và chạy luôn, go test để chạy unit test và benchmark, và go fmt để format code theo chuẩn thống nhất (bắt buộc trong hầu hết project).
- Về chất lượng code,
go vetphát hiện các lỗi tiềm ẩn mà compiler không bắt được, còngolangci-lintlà công cụ linting tổng hợp chạy hàng chục linter cùng lúc. - Ngoài ra còn có
go modcho quản lý dependency,go generatecho code generation,go docđể xem documentation, vàgo tool pprofđể profiling hiệu năng ứng dụng.
Go ships with a powerful built-in toolchain: go build compiles to a binary, go run compiles and runs immediately, go test runs unit tests and benchmarks, and go fmt formats code to the universal Go style (enforced in most projects).
- For code quality:
go vetcatches common mistakes the compiler misses, andgolangci-lintruns dozens of linters simultaneously. - Also included:
go modfor dependency management,go generatefor code generation,go docfor viewing documentation, andgo tool pproffor performance profiling.