diff options
Diffstat (limited to 'nexgb/xgb_help.go')
-rw-r--r-- | nexgb/xgb_help.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nexgb/xgb_help.go b/nexgb/xgb_help.go index b54ab41..6d07938 100644 --- a/nexgb/xgb_help.go +++ b/nexgb/xgb_help.go @@ -1,6 +1,7 @@ package xgb import ( + "errors" "fmt" "strings" ) @@ -16,6 +17,12 @@ func sprintf(format string, v ...interface{}) string { return fmt.Sprintf(format, v...) } +// newError is just a wrapper for errors.New. Exists for the same reason +// that 'stringsJoin' and 'sprintf' exists. +func newError(format string, v ...interface{}) error { + return errors.New(fmt.Sprintf(format, v...)) +} + // Pad a length to align on 4 bytes. func pad(n int) int { return (n + 3) & ^3 |