Skip to content

Commit 60d73be

Browse files
committed
refactor: replace github.com/pkg/errors with stdlib
1 parent 36d17ba commit 60d73be

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

database/rqlite/rqlite.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/golang-migrate/migrate/v4"
1313
"github.com/golang-migrate/migrate/v4/database"
1414
"github.com/hashicorp/go-multierror"
15-
"github.com/pkg/errors"
1615
"github.com/rqlite/gorqlite"
1716
)
1817

@@ -292,7 +291,7 @@ func parseUrl(url string) (*nurl.URL, *Config, error) {
292291
}
293292

294293
if parsedUrl.Scheme != "rqlite" {
295-
return nil, nil, errors.Wrap(ErrBadConfig, "bad scheme")
294+
return nil, nil, fmt.Errorf("bad scheme: %w", ErrBadConfig)
296295
}
297296

298297
// adapt from rqlite to http/https schemes
@@ -316,7 +315,7 @@ func parseConfigFromQuery(queryVals nurl.Values) (*Config, error) {
316315
migrationsTable := queryVals.Get("x-migrations-table")
317316
if migrationsTable != "" {
318317
if strings.HasPrefix(migrationsTable, "sqlite_") {
319-
return nil, errors.Wrap(ErrBadConfig, "invalid value for x-migrations-table")
318+
return nil, fmt.Errorf("invalid value for x-migrations-table: %w", ErrBadConfig)
320319
}
321320
c.MigrationsTable = migrationsTable
322321
}
@@ -325,7 +324,7 @@ func parseConfigFromQuery(queryVals nurl.Values) (*Config, error) {
325324
if connectInsecureStr != "" {
326325
connectInsecure, err := strconv.ParseBool(connectInsecureStr)
327326
if err != nil {
328-
return nil, errors.Wrap(ErrBadConfig, "invalid value for x-connect-insecure")
327+
return nil, fmt.Errorf("invalid value for x-connect-insecure: %w", ErrBadConfig)
329328
}
330329
c.ConnectInsecure = connectInsecure
331330
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ require (
163163
github.com/opencontainers/image-spec v1.1.0 // indirect
164164
github.com/pierrec/lz4/v4 v4.1.16 // indirect
165165
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
166-
github.com/pkg/errors v0.9.1
166+
github.com/pkg/errors v0.9.1 // indirect
167167
github.com/pmezard/go-difflib v1.0.0 // indirect
168168
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
169169
github.com/rqlite/gorqlite v0.0.0-20230708021416-2acd02b70b79

0 commit comments

Comments
 (0)