summaryrefslogtreecommitdiff
path: root/xgb_help.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <[email protected]>2012-05-07 01:00:45 -0400
committerAndrew Gallant (Ocelot) <[email protected]>2012-05-07 01:00:45 -0400
commit902f3ad5b8e759879141c3b77a44e3bfdaa298bb (patch)
treee7197eac09d56059cad0e9e2dbfb9379a62907eb /xgb_help.go
parent26191c0f45bd6a112085c44c271a135d65c80f18 (diff)
added tests
Diffstat (limited to 'xgb_help.go')
-rw-r--r--xgb_help.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/xgb_help.go b/xgb_help.go
index b54ab41..6d07938 100644
--- a/xgb_help.go
+++ b/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