diff --git a/Makefile b/Makefile index 6d55bba0c..42b674e31 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,7 @@ gometalinter: require-gometalinter --enable=gotypex \ --enable=ineffassign \ --enable=interfacer \ + --enable=maligned \ --enable=misspell \ --enable=nakedret \ --enable=unparam \ diff --git a/cluster.go b/cluster.go index 479047ca8..ff8042b87 100644 --- a/cluster.go +++ b/cluster.go @@ -164,7 +164,7 @@ type nodeAction struct { } // cluster represents a collection of nodes. -type cluster struct { +type cluster struct { // nolint: maligned id string Node *Node Nodes []*Node // TODO phase this out? diff --git a/ctl/import.go b/ctl/import.go index 76b794a93..9147d4664 100644 --- a/ctl/import.go +++ b/ctl/import.go @@ -32,7 +32,7 @@ import ( ) // ImportCommand represents a command for bulk importing data. -type ImportCommand struct { +type ImportCommand struct { // nolint: maligned // Destination host and port. Host string `json:"host"` diff --git a/enterprise/b/containers_btree.go b/enterprise/b/containers_btree.go index 0ed240548..d687c88a3 100644 --- a/enterprise/b/containers_btree.go +++ b/enterprise/b/containers_btree.go @@ -88,13 +88,13 @@ func (u updater) update(oldV *roaring.Container, exists bool) (*roaring.Containe // this struct is added to prevent the closure locals from being escaped out to the heap type updater struct { key uint64 - containerType byte n int + containerType byte mapped bool } func (btc *bTreeContainers) PutContainerValues(key uint64, containerType byte, n int, mapped bool) { - a := updater{key, containerType, n, mapped} + a := updater{key, n, containerType, mapped} btc.tree.Put(key, a.update) } diff --git a/field.go b/field.go index c89b55bd3..d5d5c5948 100644 --- a/field.go +++ b/field.go @@ -1113,13 +1113,13 @@ func (p fieldInfoSlice) Less(i, j int) bool { return p[i].Name < p[j].Name } // FieldOptions represents options to set when initializing a field. type FieldOptions struct { - Type string `json:"type,omitempty"` - CacheType string `json:"cacheType,omitempty"` - CacheSize uint32 `json:"cacheSize,omitempty"` Min int64 `json:"min,omitempty"` Max int64 `json:"max,omitempty"` - TimeQuantum TimeQuantum `json:"timeQuantum,omitempty"` Keys bool `json:"keys"` + CacheSize uint32 `json:"cacheSize,omitempty"` + CacheType string `json:"cacheType,omitempty"` + Type string `json:"type,omitempty"` + TimeQuantum TimeQuantum `json:"timeQuantum,omitempty"` } // applyDefaultOptions returns a new FieldOptions object diff --git a/server.go b/server.go index db577fb86..badf06f8c 100644 --- a/server.go +++ b/server.go @@ -41,7 +41,7 @@ const ( var _ broadcaster = &Server{} // Server represents a holder wrapped by a running HTTP server. -type Server struct { +type Server struct { // nolint: maligned // Close management. wg sync.WaitGroup closing chan struct{}