mirror of
https://github.com/kataras/iris.git
synced 2026-03-09 18:05:57 +00:00
formatting
Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a
This commit is contained in:
@@ -8,10 +8,8 @@ import (
|
||||
"github.com/iris-contrib/go.uuid"
|
||||
)
|
||||
|
||||
var (
|
||||
// Prefix the error prefix, applies to each error's message.
|
||||
Prefix = ""
|
||||
)
|
||||
// Prefix the error prefix, applies to each error's message.
|
||||
var Prefix = ""
|
||||
|
||||
// Error holds the error message, this message never really changes
|
||||
type Error struct {
|
||||
|
||||
@@ -14,7 +14,6 @@ var userMail = "user1@mail.go"
|
||||
var expectedUserAlreadyExists = "User with mail: user1@mail.go already exists"
|
||||
|
||||
func ExampleError() {
|
||||
|
||||
fmt.Print(errUserAlreadyExists.Format(userMail).Append("Please change your mail addr"))
|
||||
|
||||
// Output:
|
||||
@@ -38,7 +37,6 @@ func TestFormat(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAppendErr(t *testing.T) {
|
||||
|
||||
errChangeMailMsg := "Please change your mail addr"
|
||||
errChangeMail := fmt.Errorf(errChangeMailMsg) // test go standard error
|
||||
errAppended := errUserAlreadyExists.AppendErr(errChangeMail)
|
||||
|
||||
@@ -78,7 +78,6 @@ func (r *Reporter) AddErr(err error) bool {
|
||||
//
|
||||
// Returns true if this "err" is not nil and it's added to the reporter's stack.
|
||||
func (r *Reporter) Add(format string, a ...interface{}) bool {
|
||||
|
||||
if format == "" && len(a) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user