Ensure values aren't nil before decoding.

This commit is contained in:
Alec Thomas
2020-12-04 16:14:16 +11:00
parent 5a9b3ae012
commit 3d57e73d11
4 changed files with 43 additions and 3 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ func TestJSONUnmarshaler(t *testing.T) {
Value jsonUnmarshalerValue
}
p := mustNew(t, &cli)
_, err := p.Parse([]string{"--value=hello"})
_, err := p.Parse([]string{"--value=\"hello\""})
require.NoError(t, err)
require.Equal(t, "HELLO", string(cli.Value))
}