diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-07 01:00:45 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-07 01:00:45 -0400 |
commit | fd30f1512a713ae5b3cbacddfe9f29dfccc82047 (patch) | |
tree | 5801b9fe74106d9780efa23cd1b2c238ba5ffad9 /nexgb/xgb_help.go | |
parent | 6d545e723a7e972998a0e77adcf2219a31a9b800 (diff) | |
download | haven-fd30f1512a713ae5b3cbacddfe9f29dfccc82047.tar.gz haven-fd30f1512a713ae5b3cbacddfe9f29dfccc82047.tar.xz haven-fd30f1512a713ae5b3cbacddfe9f29dfccc82047.zip |
added tests
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 |