Pull request: all: update go and backend tools
Updates #2275. Squashed commit of the following: commit f24c26cd2b49fac00a581936da4ccb13ca341bc9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 21:33:15 2021 +0300 aghtest: imp docs commit 46f5b06f9743e800b489e8c30af07d24bfdcf989 Merge: bfb852cb55d4c7eeAuthor: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 21:32:32 2021 +0300 Merge branch 'master' into 2275-upd commit bfb852cbc74ec219a41e985f2dcb090d58299aee Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 19:06:32 2021 +0300 scripts: rem unsupported platform commit c1645e247f18d384a980c60d3a94b9363f83f174 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 18:47:57 2021 +0300 all: rollback more commit 989811b5e38498234dc11baf5dd153c76b9dada4 Merge: 976bdfbd2d704242Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 18:30:42 2021 +0300 Merge branch 'master' into 2275-upd commit 976bdfbdd44983f4cd657a486b94ff63f5885fd5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 18:28:23 2021 +0300 aghtest: fix os_windows commit 9e85080eefe882d72c939969f7008e3c46467c0c Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Mar 10 18:15:37 2021 +0300 all: rewrite windows workaround, imp code, docs commit 35a0b1d8656640a962fe9ae019c3d665f42707ce Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jan 21 20:38:17 2021 +0300 all: update go and backend tools
This commit is contained in:
28
HACKING.md
28
HACKING.md
@@ -1,6 +1,6 @@
|
||||
# AdGuard Home Developer Guidelines
|
||||
|
||||
As of **February 2021**, this document is partially a work-in-progress, but
|
||||
As of **March 2021**, this document is partially a work-in-progress, but
|
||||
should still be followed. Some of the rules aren't enforced as thoroughly or
|
||||
remain broken in old code, but this is still the place to find out about what we
|
||||
**want** our code to look like.
|
||||
@@ -73,6 +73,32 @@ on GitHub and most other Markdown renderers. -->
|
||||
* Constructors should validate their arguments and return meaningful errors.
|
||||
As a corollary, avoid lazy initialization.
|
||||
|
||||
* Don't mix horizontal and vertical placement of arguments in function and
|
||||
method calls. That is, either this:
|
||||
|
||||
```go
|
||||
err := f(a, b, c)
|
||||
```
|
||||
|
||||
Or, when the arguments are too long, this:
|
||||
|
||||
```go
|
||||
err := functionWithALongName(
|
||||
firstArgumentWithALongName,
|
||||
secondArgumentWithALongName,
|
||||
thirdArgumentWithALongName,
|
||||
)
|
||||
```
|
||||
|
||||
But **never** this:
|
||||
|
||||
```go
|
||||
err := functionWithALongName(firstArgumentWithALongName,
|
||||
secondArgumentWithALongName,
|
||||
thirdArgumentWithALongName,
|
||||
)
|
||||
```
|
||||
|
||||
* Don't use naked `return`s.
|
||||
|
||||
* Don't use underscores in file and package names, unless they're build tags
|
||||
|
||||
Reference in New Issue
Block a user