diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ab4a10b..8f6fc4e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,7 +9,7 @@ on: env: GO_VERSION: ^1.21 - GOLANGCI_LINT_VERSION: v1.54.0 + GOLANGCI_LINT_VERSION: v1.55.0 jobs: go_install: diff --git a/README.md b/README.md index bfa98d8..9ddf33c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ spanlint ./... ## Configuration -```bash +```txt $ spanlint -h Usage of spanlint: -disable-end-check @@ -96,15 +96,15 @@ Not calling `SetStatus` prevents the `status` attribute from being set to `error ```go func _() error { - _, span := otel.Tracer("foo").Start(context.Background(), "bar") // span.SetStatus is not called on all paths - defer span.End() + _, span := otel.Tracer("foo").Start(context.Background(), "bar") // span.SetStatus is not called on all paths + defer span.End() - if err := subTask(); err != nil { + if err := subTask(); err != nil { span.RecordError(err) - return errors.New(err) // return can be reached without calling span.SetStatus - } + return errors.New(err) // return can be reached without calling span.SetStatus + } - return nil + return nil } ``` @@ -119,10 +119,10 @@ func _() error { _, span := otel.Tracer("foo").Start(context.Background(), "bar") // span.RecordError is not called on all paths defer span.End() - if err := subTask(); err != nil { + if err := subTask(); err != nil { span.SetStatus(codes.Error, err.Error()) return errors.New(err) // return can be reached without calling span.RecordError - } + } return nil }