Skip to content

Commit

Permalink
ext: ecssd Fix linter errors
Browse files Browse the repository at this point in the history
Its shadow warning seems to be a bit buggy
  • Loading branch information
pingleig committed Jun 1, 2021
1 parent b01f80e commit cb59062
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions extension/observer/ecsobserver/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ import (
// for log and metrics that can be used for debugging.

const (
errKeyTask = "task"
errKeyContainer = "container"
errKeyTarget = "target"
errKeyTask = "task"
errKeyTarget = "target"
)

type errWithAttributes interface {
Expand Down Expand Up @@ -73,7 +72,9 @@ func extractErrorFields(err error) ([]zap.Field, string) {
fields = errAttr.zapFields()
v, ok := errctx.ValueFrom(err, errKeyTask)
if ok {
if task, ok := v.(*Task); ok {
// Rename ok to tok because linter says it shadows outer ok.
// Though the linter seems to allow the similar block to shadow...
if task, tok := v.(*Task); tok {
fields = append(fields, zap.String("TaskArn", aws.StringValue(task.Task.TaskArn)))
scope = "Task"
}
Expand Down
2 changes: 1 addition & 1 deletion extension/observer/ecsobserver/internal/errctx/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func WithValue(err error, key string, val interface{}) error {
}
}

// WithValues attaches multiple key value pairs. The behaviour is similar to WithValue.
// WithValues attaches multiple key value pairs. The behavior is similar to WithValue.
func WithValues(err error, kvs map[string]interface{}) error {
if err == nil {
return nil
Expand Down

0 comments on commit cb59062

Please sign in to comment.