-
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
13 changed files
with
96 additions
and
108 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
package error | ||
|
||
// Caller defines an interface to runtime caller results. | ||
type Caller interface { | ||
// File returns the file in which the call occurred. | ||
File() string | ||
|
||
// Func returns the name of the function in which the call occurred. | ||
Func() string | ||
|
||
// Line returns the line number in the file in which the call occurred. | ||
Line() int | ||
|
||
// Pc returns the program counter. | ||
Pc() uintptr | ||
|
||
// Trace returns the call stack. | ||
Trace() Trace | ||
} |
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,21 @@ | ||
package error | ||
|
||
// Error defines a robust error stack interface. | ||
type Error interface { | ||
// Caller returns the associated Caller instance. | ||
Caller() Caller | ||
|
||
// Error implements error. | ||
Error() string | ||
|
||
// 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