Skip to content

Commit

Permalink
lint & gofmt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pmm-sumo committed Oct 4, 2021
1 parent a470b8c commit 1430ee5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
6 changes: 3 additions & 3 deletions processor/cascadingfilterprocessor/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ func TestLoadConfig(t *testing.T) {
NamePattern: &healthCheckNamePatternValue,
},
{
Name: "remove-all-traces-with-healthcheck-service",
NamePattern: nil,
Name: "remove-all-traces-with-healthcheck-service",
NamePattern: nil,
NumericAttributeCfg: nil,
StringAttributeCfg: &cfconfig.StringAttributeCfg{
Key: "service.name",
Key: "service.name",
Values: []string{"healthcheck"},
},
},
Expand Down
14 changes: 6 additions & 8 deletions processor/sourceprocessor/attribute_filler.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ func createSourceCategoryFiller(cfg *Config, keys sourceTraceKeys) attributeFill
return filler
}

func (f *attributeFiller) fillResourceOrUseAnnotation(atts *pdata.AttributeMap, annotationKey string, keys sourceTraceKeys) bool {
func (f *attributeFiller) fillResourceOrUseAnnotation(atts *pdata.AttributeMap, annotationKey string, keys sourceTraceKeys) {
val, found := atts.Get(annotationKey)
if found {
annotationFiller := extractFormat(val.StringVal(), f.name, keys)
annotationFiller.dashReplacement = f.dashReplacement
annotationFiller.compiledFormat = f.prefix + annotationFiller.compiledFormat
return annotationFiller.fillAttributes(atts)
annotationFiller.fillAttributes(atts)
} else {
f.fillAttributes(atts)
}

return f.fillAttributes(atts)
}

func (f *attributeFiller) fillAttributes(atts *pdata.AttributeMap) bool {
func (f *attributeFiller) fillAttributes(atts *pdata.AttributeMap) {
if len(f.compiledFormat) == 0 {
return false
return
}

labelValues := f.resourceLabelValues(atts)
Expand All @@ -106,9 +106,7 @@ func (f *attributeFiller) fillAttributes(atts *pdata.AttributeMap) bool {
str = strings.ReplaceAll(str, "-", f.dashReplacement)
}
atts.UpsertString(f.name, str)
return true
}
return false
}

func (f *attributeFiller) resourceLabelValues(atts *pdata.AttributeMap) []interface{} {
Expand Down
2 changes: 1 addition & 1 deletion processor/sourceprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func createDefaultConfig() config.Processor {
// createTraceProcessor creates a trace processor based on this config.
func createTraceProcessor(
_ context.Context,
params component.ProcessorCreateSettings,
_ component.ProcessorCreateSettings,
cfg config.Processor,
next consumer.Traces) (component.TracesProcessor, error) {

Expand Down

0 comments on commit 1430ee5

Please sign in to comment.