-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
82 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
/* | ||
Package std provides useful go interfaces for building consistent, testable, | ||
mockable packages. | ||
Interfaces available in the standard library should be preferred over anything | ||
you find here. | ||
*/ | ||
// Package std provides useful go interfaces for building consistent, testable, | ||
// mockable packages. | ||
// | ||
// Interfaces available in the standard library should be preferred over anything | ||
// you find here. | ||
package std |
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,23 +1,21 @@ | ||
package error | ||
|
||
// Error defines a slightly more robust error interface than the standard | ||
// library. | ||
// Error defines a robust error stack interface. | ||
type Error interface { | ||
// Code returns the associated error code. A value of 0 should be | ||
// considered uncoded. | ||
Code() Code | ||
// Caller returns the runtime caller information for this error. | ||
// Caller returns the associated Caller instance. | ||
Caller() Caller | ||
// Err returns the original error | ||
Err() error | ||
// Error implements standard library compatibility. Error should return the | ||
// string associated with the error code, or the error message if there | ||
// isn't one | ||
|
||
// Error implements error. | ||
Error() string | ||
// String is an alias of Error. | ||
String() string | ||
// Msg returns the original error message. | ||
Msg() string | ||
// Trace returns the full stack trace of this error. | ||
Trace() Trace | ||
|
||
// Has tests to see if the test error exists anywhere in the error | ||
// stack. | ||
Has(test error) bool | ||
|
||
// Is tests to see if the test error matches most recent error in the | ||
// stack. | ||
Is(test error) bool | ||
|
||
// Unwrap returns the next error, if any. | ||
Unwrap() Error | ||
} |
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,7 +1,4 @@ | ||
package error | ||
|
||
// Code defines an error code type. | ||
type Code int | ||
|
||
// Trace defines an error trace. | ||
type Trace []Caller |
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,3 +1,3 @@ | ||
module github.com/bdlm/std | ||
module github.com/bdlm/std/v2 | ||
|
||
go 1.14 |
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
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