Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-21 18:21:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-21 18:21:10 +0300
commite33f87ac0fabaab468ce4b457996cc0f1b1bb648 (patch)
tree8bf0de72a9acac014cfdaddab7d463b208294af2 /doc/development/go_guide
parent5baf990db20a75078684702782c24399ef9eb0fa (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/go_guide')
-rw-r--r--doc/development/go_guide/index.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/development/go_guide/index.md b/doc/development/go_guide/index.md
index 975b524c1df..c1dfb220df8 100644
--- a/doc/development/go_guide/index.md
+++ b/doc/development/go_guide/index.md
@@ -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).