Commit 7752cfca authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'add-secure-specific-coding-style-guide' into 'master'

Add Secure Team specific style to Go guidelines

See merge request gitlab-org/gitlab!29753
parents 20f7e1a0 8752d024
......@@ -379,6 +379,24 @@ are:
To reduce unnecessary differences between two distribution methods, Omnibus and
CNG **should always use the same Go version**.
## Secure Team standards and style guidelines
The following are some style guidelines that are specific to the Secure Team.
### Code style and format
Use `goimports -local gitlab.com/gitlab-org` before committing.
[goimports](https://godoc.org/golang.org/x/tools/cmd/goimports)
is a tool that automatically formats Go source code using
[Gofmt](https://golang.org/cmd/gofmt/), in addition to formatting import lines,
adding missing ones and removing unreferenced ones.
By using the `-local gitlab.com/gitlab-org` option, `goimports` will group locally referenced
packages separately from external ones. See
[the imports section](https://github.com/golang/go/wiki/CodeReviewComments#imports)
of the Code Review Comments page on the Go wiki for more details.
Most editors/IDEs will allow you to run commands before/after saving a file, you can set it
up to run `goimports -local gitlab.com/gitlab-org` so that it's applied to every file when saving.
---
[Return to Development documentation](../README.md).
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment