diff options
Diffstat (limited to 'docs/languages/golang.md')
-rw-r--r-- | docs/languages/golang.md | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/docs/languages/golang.md b/docs/languages/golang.md index 6f1cf2f..1a054ec 100644 --- a/docs/languages/golang.md +++ b/docs/languages/golang.md @@ -2,16 +2,20 @@ ## Definitions -- A `Program` is a program, service, or application which is NOT a library. +- A `Program` is a program, service, or application which is NOT a + library. - A `Library` is code designed only for consumption by other programs. ## Requirements -- Builds MUST use the [Go-provided compiler][1]. - Builds MUST NOT use the [gcc-go][2] compiler or other alternatives. -- Programs MUST update and commit the `go.mod` and `go.sum` using `go mod tidy`. -- Programs MUST [vendor dependency code][4] and commit the vendored code to their repository. -- CI builds MUST use the [golangci-lint][5] linter as a first-stage validation step +- Builds MUST use the [Go-provided compiler][1]. Builds MUST NOT use + the [gcc-go][2] compiler or other alternatives. +- Programs MUST update and commit the `go.mod` and `go.sum` using `go + mod tidy`. +- Programs MUST [vendor dependency code][4] and commit the vendored code + to their repository. +- CI builds MUST use the [golangci-lint][5] linter as a first-stage + validation step - Programs SHOULD use the [standard project layout][3] - Programs MUST NOT use CGO unless there is no pure-Go alternative. Appropriate uses of CGO include Oracle DB drivers, GPGPU computation. @@ -27,16 +31,19 @@ ### Local Environment -- Run `go build`, `golangci-lint run`, and `go test` before pushing code for your PR. -- Fork the repository, then commit and push changes to the fork frequently. - This avoids catastrophic data loss and enables Work In Progress (WIP) sharing. +- Run `go build`, `golangci-lint run`, and `go test` before pushing code + for your PR. +- Fork the repository, then commit and push changes to the fork + frequently. This avoids catastrophic data loss and enables Work In + Progress (WIP) sharing. ### Go language - Errors MUST be handled -- Programs and Libaries SHOULD NOT use third-party libraries. - Prefer standard library packages. -- Use [gofumports](https://github.com/mvdan/gofumpt) for formatting and automatic imports +- Programs and Libaries SHOULD NOT use third-party libraries. Prefer + standard library packages. +- Use [gofumports](https://github.com/mvdan/gofumpt) for formatting and + automatic imports - Test functions MUST check both the error result and the returned data. [RFC2119]:https://www.rfc-editor.org/rfc/rfc2119.txt |