fix lint issues (#16)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-02-13 01:46:16 +03:00
committed by GitHub
parent fd5ed64729
commit abb9937787
19 changed files with 108 additions and 79 deletions

View File

@@ -185,6 +185,7 @@ metadata:
{{- end }}
`
//nolint:gosec
var secretTmpl = `
apiVersion: v1
kind: Secret

View File

@@ -248,7 +248,8 @@ func (s *Server) handleQuery(query *dns.Msg, from net.Addr) error {
return fmt.Errorf("[ERR] mdns: support for DNS requests with high truncated bit not implemented: %v", *query)
}
var unicastAnswer, multicastAnswer []dns.RR
unicastAnswer := make([]dns.RR, 0, len(query.Question))
multicastAnswer := make([]dns.RR, 0, len(query.Question))
// Handle each question
for _, q := range query.Question {

View File

@@ -243,7 +243,7 @@ func MergeMap(a interface{}, b map[string]interface{}) error {
if fva.Elem().Type().Kind() == reflect.Struct {
for i := 0; i < fva.Elem().NumField(); i++ {
field := fva.Elem().Field(i)
if field.Type().Kind() == reflect.Ptr && field.IsNil() && fva.Elem().Type().Field(i).Anonymous == true {
if field.Type().Kind() == reflect.Ptr && field.IsNil() && fva.Elem().Type().Field(i).Anonymous {
field.Set(reflect.New(field.Type().Elem()))
}
}

View File

@@ -62,7 +62,7 @@ func (l literal) compile() []op {
}
func (v variable) compile() []op {
var ops []op
ops := make([]op, 0, len(v.segments))
for _, s := range v.segments {
ops = append(ops, s.compile()...)
}
@@ -78,11 +78,12 @@ func (v variable) compile() []op {
}
func (t template) Compile() Template {
var rawOps []op
rawOps := make([]op, 0, len(t.segments))
for _, s := range t.segments {
rawOps = append(rawOps, s.compile()...)
}
//ops := make([]int, 0, len(rawOps))
var (
ops []int
pool []string

View File

@@ -36,7 +36,7 @@ func (r *request) Codec() codec.Codec {
}
func (r *request) Header() metadata.Metadata {
md, _ := metadata.FromContext(r.context)
md, _ := metadata.FromIncomingContext(r.context)
return md
}

View File

@@ -16,12 +16,9 @@ func (c *syncStore) syncManager() {
}
}(i, tickerAggregator, ticker)
}
for {
select {
case i := <-tickerAggregator:
println(i.index, "ticked")
c.processQueue(i.index)
}
for i := range tickerAggregator {
println(i.index, "ticked")
c.processQueue(i.index)
}
}