diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index 1b52024..9d719e5 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -51,7 +51,7 @@ type Metric struct { // Labels list of tags func (m *Metric) Labels() []string { - if m.Tags == nil || len(m.Tags) == 0 || m.Tags[0] == nil || len(m.Tags[0]) == 0 { + if len(m.Tags) == 0 || len(m.Tags[0]) == 0 { return nil } labels := make([]string, 0, len(m.Tags[0])) @@ -62,7 +62,7 @@ func (m *Metric) Labels() []string { } func (m *Metric) tagValues() *patternkey.PatterKeys { - if m.Tags == nil || len(m.Tags) == 0 || m.Tags[0] == nil || len(m.Tags[0]) == 0 { + if len(m.Tags) == 0 || len(m.Tags[0]) == 0 { return nil } vals := make([]string, 0, len(m.Tags[0])) diff --git a/storage/ncstreams/stream.go b/storage/ncstreams/stream.go index 17c79d6..f7309c2 100644 --- a/storage/ncstreams/stream.go +++ b/storage/ncstreams/stream.go @@ -38,7 +38,7 @@ func newStream(pub nc.Publisher, conf *stream.Config) (eventstream.Streamer, err } for _, target := range preConfig.Targets { var fields map[string]any - if target.Fields != nil && len(target.Fields) > 0 { + if len(target.Fields) > 0 { fields = target.Fields } template, err := newMessageTemplate(fields, target.Where)