-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathaliases.go
More file actions
27 lines (23 loc) · 566 Bytes
/
aliases.go
File metadata and controls
27 lines (23 loc) · 566 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
// Join is an alias of the standard errors.Join function.
Join = errors.Join
)
func sprintf(format string, args ...any) string {
if len(args) > 0 {
return fmt.Sprintf(format, args...)
}
return format
}