Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: "1.25"

- name: Build
run: go build -v ./...
Expand Down
4 changes: 2 additions & 2 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ func NewWithStatus(msg string, status *grpcstatus.Status) ErrorExt {

// NewWithSkip creates a new error skipping the number of function on the stack
func NewWithSkip(msg string, skip int) ErrorExt {
return WrapWithSkip(fmt.Errorf(msg), "", skip+1)
return WrapWithSkip(fmt.Errorf("%s", msg), "", skip+1)
}

// NewWithSkipAndStatus creates a new error skipping the number of function on the stack and GRPC status
func NewWithSkipAndStatus(msg string, skip int, status *grpcstatus.Status) ErrorExt {
return WrapWithSkipAndStatus(fmt.Errorf(msg), "", skip+1, status)
return WrapWithSkipAndStatus(fmt.Errorf("%s", msg), "", skip+1, status)
}
Comment on lines 156 to 164
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt.Errorf("%s", msg) is equivalent to errors.New(msg) here, but incurs formatting overhead and makes intent less direct. Consider using errors.New(msg) (from the stdlib) for a simple string error while still satisfying go vet’s constant-format requirement.

Copilot uses AI. Check for mistakes.

// Wrap wraps an existing error and appends stack information if it does not exists
Expand Down
23 changes: 17 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
module github.com/go-coldbrew/errors

go 1.15
go 1.25.0

require (
github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054 // indirect
github.com/getsentry/raven-go v0.2.0
github.com/go-coldbrew/log v0.2.0
github.com/go-coldbrew/options v0.0.0-20210109113138-49c7e5781276
github.com/google/uuid v1.3.0
github.com/go-coldbrew/log v0.2.4
github.com/go-coldbrew/options v0.2.3
github.com/google/uuid v1.6.0
github.com/opentracing/opentracing-go v1.2.0
github.com/stvp/rollbar v0.5.1
google.golang.org/grpc v1.56.3
google.golang.org/grpc v1.79.3
gopkg.in/airbrake/gobrake.v2 v2.0.9
)

require (
github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.1 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.39.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
golang.org/x/sys v0.42.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect
google.golang.org/protobuf v1.36.11 // indirect
)
Loading
Loading