From fd30f1512a713ae5b3cbacddfe9f29dfccc82047 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 7 May 2012 01:00:45 -0400 Subject: added tests --- nexgb/xgb_help.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nexgb/xgb_help.go') 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 -- cgit v1.2.3