Refactor encoding to use *string instead of string as input
I don't want to clone the whole input string
This commit is contained in:
@@ -11,7 +11,7 @@ func TestASCIIEncodeSimpleASCIIString(t *testing.T) {
|
||||
input := "Hello, World!"
|
||||
|
||||
expected := []byte{72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33}
|
||||
err := coder.Encode(input, &buf)
|
||||
err := coder.Encode(&input, &buf)
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Expected no error, but got %v", err)
|
||||
@@ -46,7 +46,7 @@ func TestASCIIEncodeEmptyString(t *testing.T) {
|
||||
input := ""
|
||||
|
||||
expected := []byte{}
|
||||
err := coder.Encode(input, &buf)
|
||||
err := coder.Encode(&input, &buf)
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Expected no error, but got %v", err)
|
||||
|
Reference in New Issue
Block a user