aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-02-13 19:49:58 +0700
committerShulhan <m.shulhan@gmail.com>2020-02-13 20:22:52 +0700
commita011abc1da757f69cc27e6c8475b5ae9fdf83bd2 (patch)
tree9dc6aaacbb123c948fa26381d25701ebf2227ff7 /lib
parent0f5515b0b7d41662306aee41b22f5fa2534dfce7 (diff)
downloadpakakeh.go-a011abc1da757f69cc27e6c8475b5ae9fdf83bd2.tar.xz
all: suppress false-positive linter warnings
Diffstat (limited to 'lib')
-rw-r--r--lib/dns/message.go2
-rw-r--r--lib/dns/server.go1
-rw-r--r--lib/email/body.go2
-rw-r--r--lib/email/field.go2
-rw-r--r--lib/ini/ini.go1
-rw-r--r--lib/smtp/command.go3
6 files changed, 6 insertions, 5 deletions
diff --git a/lib/dns/message.go b/lib/dns/message.go
index 5b6ba4e2..6f26ca9a 100644
--- a/lib/dns/message.go
+++ b/lib/dns/message.go
@@ -48,7 +48,7 @@ import (
//
// [1] RFC 1035 - 4.1. Format
//
-type Message struct {
+type Message struct { //nolint: maligned
Header SectionHeader
Question SectionQuestion
Answer []ResourceRecord
diff --git a/lib/dns/server.go b/lib/dns/server.go
index f8995cd1..665c8f50 100644
--- a/lib/dns/server.go
+++ b/lib/dns/server.go
@@ -1123,6 +1123,7 @@ func (srv *Server) runUDPForwarder(tag, nameserver string,
}
}
+//nolint: interfacer
func (srv *Server) stopForwarder(fw Client, hasFallback bool) {
if fw != nil {
fw.Close()
diff --git a/lib/email/body.go b/lib/email/body.go
index 82d295a3..04f87402 100644
--- a/lib/email/body.go
+++ b/lib/email/body.go
@@ -117,7 +117,7 @@ func (body *Body) String() string {
// This function is expensive for message with large body, its better if we
// call it once and store it somewhere.
//
-func (body *Body) Relaxed() (out []byte) {
+func (body *Body) Relaxed() (out []byte) { //nolint: gocognit
if len(body.raw) == 0 {
return
}
diff --git a/lib/email/field.go b/lib/email/field.go
index 89887a60..d6d721f0 100644
--- a/lib/email/field.go
+++ b/lib/email/field.go
@@ -325,7 +325,7 @@ func (field *Field) updateType() {
// second = 2DIGIT
// zone = ("+" / "-") 4DIGIT
//
-func (field *Field) unpackDate() (err error) {
+func (field *Field) unpackDate() (err error) { //nolint: gocognit
var (
v []byte
ok bool
diff --git a/lib/ini/ini.go b/lib/ini/ini.go
index 4444b3ff..1e9c007b 100644
--- a/lib/ini/ini.go
+++ b/lib/ini/ini.go
@@ -225,6 +225,7 @@ func Unmarshal(b []byte, v interface{}) (err error) {
return nil
}
+//nolint: gocyclo
func unmarshalStruct(ini *Ini, rtipe reflect.Type, rvalue reflect.Value) {
numField := rtipe.NumField()
if numField == 0 {
diff --git a/lib/smtp/command.go b/lib/smtp/command.go
index 7725198c..d9c58608 100644
--- a/lib/smtp/command.go
+++ b/lib/smtp/command.go
@@ -142,8 +142,7 @@ func (cmd *Command) reset() {
//
// unpack parse a command type, argument, and their parameters.
//
-//nolint:gocyclo
-func (cmd *Command) unpack(b []byte) (err error) {
+func (cmd *Command) unpack(b []byte) (err error) { //nolint:gocyclo,gocognit
// Minimum command length is 4 + CRLF.
if len(b) < 6 {
return errCmdUnknown