diff --git a/values.go b/values.go index fbde077..273fa68 100644 --- a/values.go +++ b/values.go @@ -32,18 +32,18 @@ func readValue(b []byte) (value, error) { // ------------------------------------------------------------------------------ -type simpleString string +type String string func readString(b []byte) (value, error) { - return simpleString(strings.Trim(string(b), "\r\n")), nil + return String(strings.Trim(string(b), "\r\n")), nil } // ------------------------------------------------------------------------------ -type redisError string +type Error string func readError(b []byte) (value, error) { - return redisError(strings.Trim(string(b), "\r\n")), nil + return Error(strings.Trim(string(b), "\r\n")), nil } @@ -53,3 +53,5 @@ func readError(b []byte) (value, error) { + + diff --git a/values_test.go b/values_test.go index 2be9168..420e175 100644 --- a/values_test.go +++ b/values_test.go @@ -8,15 +8,15 @@ var valueTests = []struct { in string out value }{ - {"+hello", simpleString("hello")}, - {"+one two", simpleString("one two")}, // intermediate space - {"+one two ", simpleString("one two ")}, // trailing space - {"+ one two", simpleString(" one two")}, // leading space + {"+hello", String("hello")}, + {"+one two", String("one two")}, // intermediate space + {"+one two ", String("one two ")}, // trailing space + {"+ one two", String(" one two")}, // leading space - {"-hello", redisError("hello")}, - {"-one two", redisError("one two")}, // intermediate space - {"-one two ", redisError("one two ")}, // trailing space - {"- one two", redisError(" one two")}, // leading space + {"-hello", Error("hello")}, + {"-one two", Error("one two")}, // intermediate space + {"-one two ", Error("one two ")}, // trailing space + {"- one two", Error(" one two")}, // leading space } func TestValues(t *testing.T) {