1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-27 22:05:56 +00:00

new x/errors package to handle HTTP wire errors

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-02-24 23:49:46 +02:00
parent 8ded69fd7e
commit 37c766fef7
9 changed files with 646 additions and 2 deletions

25
x/errors/aliases.go Normal file
View File

@@ -0,0 +1,25 @@
package errors
import (
"errors"
"fmt"
)
var (
// Is is an alias of the standard errors.Is function.
Is = errors.Is
// As is an alias of the standard errors.As function.
As = errors.As
// New is an alias of the standard errors.New function.
New = errors.New
// Unwrap is an alias of the standard errors.Unwrap function.
Unwrap = errors.Unwrap
)
func sprintf(format string, args ...interface{}) string {
if len(args) > 0 {
return fmt.Sprintf(format, args...)
}
return format
}