Pull request: all: avoid fallthrough

Merge in DNS/adguard-home from rm-fallthrough to master

Squashed commit of the following:

commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri May 21 18:16:42 2021 +0300

    dhcpd: imp code

commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri May 21 17:54:38 2021 +0300

    all: avoid fallthrough
This commit is contained in:
Ainar Garipov
2021-05-21 18:30:57 +03:00
parent 7f2f8de922
commit 6847f7c8bb
5 changed files with 57 additions and 47 deletions

View File

@@ -69,7 +69,9 @@ on GitHub and most other Markdown renderers. -->
first statement. If all you want there is a log message, use
`agherr.LogPanic`.
* Avoid `errors.New`, use `aghnet.Error` instead.
* Avoid `fallthrough`. It makes it harder to rearrange `case`s, to reason
about the code, and also to switch the code to a handler approach, if that
becomes necessary later.
* Avoid `goto`.