-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First phase of eradicating github.com/pkg/errors (#32)
* build(deps): replace deprecated github.com/pkg/errors with stdlib replaces github.com/pkg/errors, which is now marked as archived and not maintained on github, with native >=go1.13 standard library functions. This preserves the error wrapping previously handled via errors.Wrap via the new %w directive in fmt.Errorf. * Remove 1.12 * implement errors as internal package * Add +build build constraints * tweak test name * quote * Update Changes * Update Changes * fix specifications.go Co-authored-by: Matthew Rothenberg <[email protected]>
- Loading branch information
Showing
9 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
module github.com/lestrrat-go/strftime | ||
|
||
go 1.12 | ||
go 1.13 | ||
|
||
require ( | ||
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc | ||
github.com/pkg/errors v0.8.1 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/stretchr/testify v1.3.0 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//go:build strftime_native_errors | ||
// +build strftime_native_errors | ||
|
||
package errors | ||
|
||
import "fmt" | ||
|
||
func New(s string) error { | ||
return fmt.Errorf(s) | ||
} | ||
|
||
func Errorf(s string, args ...interface{}) error { | ||
return fmt.Errorf(s, args...) | ||
} | ||
|
||
func Wrap(err error, s string) error { | ||
return fmt.Errorf(s+`: %w`, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//go:build !strftime_native_errors | ||
// +build !strftime_native_errors | ||
|
||
package errors | ||
|
||
import "github.com/pkg/errors" | ||
|
||
func New(s string) error { | ||
return errors.New(s) | ||
} | ||
|
||
func Errorf(s string, args ...interface{}) error { | ||
return errors.Errorf(s, args...) | ||
} | ||
|
||
func Wrap(err error, s string) error { | ||
return errors.Wrap(err, s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters