Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a94ec865
Commit
a94ec865
authored
Mar 27, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
26b8bd19
4fde1ba7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
doc/development/go_guide/index.md
doc/development/go_guide/index.md
+2
-2
No files found.
doc/development/go_guide/index.md
View file @
a94ec865
...
@@ -26,7 +26,7 @@ Reviewers and maintainers should pay attention to:
...
@@ -26,7 +26,7 @@ Reviewers and maintainers should pay attention to:
-
`defer`
functions: ensure the presence when needed, and after
`err`
check.
-
`defer`
functions: ensure the presence when needed, and after
`err`
check.
-
Inject dependencies as parameters.
-
Inject dependencies as parameters.
-
Void structs when marshal
l
ing to JSON (generates
`null`
instead of
`[]`
).
-
Void structs when marshaling to JSON (generates
`null`
instead of
`[]`
).
### Security
### Security
...
@@ -185,7 +185,7 @@ There are a few guidelines one should follow when using the
...
@@ -185,7 +185,7 @@ There are a few guidelines one should follow when using the
-
When printing an error use
-
When printing an error use
[
WithError
](
https://godoc.org/github.com/sirupsen/logrus#WithError
)
. For
[
WithError
](
https://godoc.org/github.com/sirupsen/logrus#WithError
)
. For
ex
ma
ple,
`logrus.WithError(err).Error("Failed to do something")`
.
ex
am
ple,
`logrus.WithError(err).Error("Failed to do something")`
.
-
Since we use
[
structured logging
](
#structured-json-logging
)
we can log
-
Since we use
[
structured logging
](
#structured-json-logging
)
we can log
fields in the context of that code path, such as the URI of the request using
fields in the context of that code path, such as the URI of the request using
[
`WithField`
](
https://godoc.org/github.com/sirupsen/logrus#WithField
)
or
[
`WithField`
](
https://godoc.org/github.com/sirupsen/logrus#WithField
)
or
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment