Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Replace github.com/pkg/errors with Go core error package #89

Merged
merged 2 commits into from
Aug 6, 2024
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
12 changes: 7 additions & 5 deletions frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package httpcache

import (
"context"
"errors"
"fmt"
"time"

"flamingo.me/flamingo/v3/framework/flamingo"
"github.com/pkg/errors"
"go.opencensus.io/trace"
"golang.org/x/sync/singleflight"
)
Expand Down Expand Up @@ -115,12 +115,14 @@ func (f *Frontend) load(ctx context.Context, key string, loader HTTPLoader) (Ent
defer fetchRoutineSpan.End()

defer func() {
// catch potential panics
if err := recover(); err != nil {
if err2, ok := err.(error); ok {
resultErr = errors.WithStack(err2)
} else {
resultErr = errors.WithStack(errors.Errorf("HTTPCache Frontend.load exception: %#v", err))
if typedError, ok := err.(error); ok {
resultErr = typedError
return
}

resultErr = fmt.Errorf("HTTPCache Frontend.load exception: %#v", err) //nolint:err113 // no dedicated error needed here
IvanMaidurov marked this conversation as resolved.
Show resolved Hide resolved
}
}()

Expand Down
7 changes: 1 addition & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
flamingo.me/flamingo/v3 v3.9.0
github.com/gomodule/redigo v1.9.2
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
github.com/testcontainers/testcontainers-go v0.32.0
go.opencensus.io v0.24.0
Expand All @@ -36,7 +35,6 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v27.0.3+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
Expand Down Expand Up @@ -67,8 +65,8 @@ require (
github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runc v1.1.12 // indirect
github.com/openzipkin/zipkin-go v0.4.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
Expand All @@ -94,12 +92,9 @@ require (
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/api v0.84.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
Expand Down
Loading
Loading