Skip to content
Merged
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
39 changes: 34 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,49 @@ on:
pull_request:
branches: [ "main" ]

permissions:
contents: read

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 ./...
run: make build

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Test
run: go test -v ./...
run: make test

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.8
args: --timeout 5m
28 changes: 28 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "2"
linters:
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- funlen
- goconst
- errcheck
- ineffassign
- staticcheck
path: (.+)_test\.go
paths:
- third_party$
- builtin$
- examples$
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
.PHONY: build doc
.PHONY: build test doc lint bench
Comment thread
ankurs marked this conversation as resolved.
build:
go build ./...

test:
go test ./...
go test -race ./...

doc:
go install github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest
gomarkdoc ./...

lint:
golangci-lint run

bench:
go test -run=^$ -bench=. -benchmem ./...
6 changes: 3 additions & 3 deletions errors.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package errors

import (
"fmt"
stderrors "errors"
"runtime"
"strings"

Expand Down 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(stderrors.New(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(stderrors.New(msg), "", skip+1, status)
}

// 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
Comment thread
ankurs marked this conversation as resolved.

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.5
github.com/go-coldbrew/options v0.2.4
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-20251202230838-ff82c1b0f217 // indirect
google.golang.org/protobuf v1.36.10 // indirect
)
Loading
Loading