Skip to content

Commit

Permalink
refactor(src): Replaces more pkg/errors usages with std lib.
Browse files Browse the repository at this point in the history
Also update go.mod file

Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
  • Loading branch information
MoritzThomasHuebner committed May 30, 2022
1 parent 456ad21 commit 63a7be4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
14 changes: 1 addition & 13 deletions src/go/README.md
Expand Up @@ -74,24 +74,12 @@ client/server implementation. Tightly coupled with protobuf.

Considered alternatives: Thrift, Swagger, JSON-RPC

### github.com/pkg/errors

BSD-2 license.

Very lightweight library, does not have any transitive dependencies. A well-
reasoned extension to built-in errors, this package provides stack tracing and
error wrap/unwrapping. Some of this functionality was added to the built-in
errors package as of Golang 1.13 (and this package influenced part of that
design), but the built-in is lacking easy stack trace support.

Considered alternatives: built-in errors, github.com/cockroachdb/errors

### Uber Zap

MIT license.

Medium weight, pulls in a few transitive dependencies, but has a large overlap
with dependencies we also use (github.com/pkg/errors, testify). Provides
with testify. Provides
scoped/named loggers and parameterized logging while achieving better
performance than other libraries proven via benchmarks.

Expand Down
2 changes: 1 addition & 1 deletion src/go/crash/crash_test.go
Expand Up @@ -12,13 +12,13 @@
package crash_test

import (
"errors"
"testing"
"time"

"github.com/golang/mock/gomock"
"github.com/magma/magma/src/go/crash"
mock_crash "github.com/magma/magma/src/go/crash/mock_crash"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)

Expand Down
1 change: 0 additions & 1 deletion src/go/go.mod
Expand Up @@ -16,7 +16,6 @@ go 1.18
require (
github.com/getsentry/sentry-go v0.11.0
github.com/golang/mock v1.6.0
github.com/pkg/errors v0.8.1
github.com/stretchr/testify v1.7.0
go.uber.org/zap v1.19.0
google.golang.org/grpc v1.40.0
Expand Down

0 comments on commit 63a7be4

Please sign in to comment.