Fix: do not silently ignore assign NULL to *string
AssignTo can only assign NULL to a **string. Previous code tried to assign nil to a *string, which did nothing. Correct behavior is to detect this as an error.
This commit is contained in:
+1
-1
@@ -129,7 +129,7 @@ func TestJSONAssignTo(t *testing.T) {
|
||||
t.Errorf("%d: %v", i, err)
|
||||
}
|
||||
|
||||
if *tt.dst == tt.expected {
|
||||
if *tt.dst != tt.expected {
|
||||
t.Errorf("%d: expected %v to assign %v, but result was %v", i, tt.src, tt.expected, *tt.dst)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user