mirror of https://github.com/jackc/pgx.git
Fix go vet identified composite leteral uses unkeyed fields
parent
9d7cf39563
commit
c5468f3037
|
@ -85,23 +85,23 @@ func TestNullHstoreTranscode(t *testing.T) {
|
||||||
{pgx.NullHstore{}, "null"},
|
{pgx.NullHstore{}, "null"},
|
||||||
{pgx.NullHstore{Valid: true}, "empty"},
|
{pgx.NullHstore{Valid: true}, "empty"},
|
||||||
{pgx.NullHstore{
|
{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{"bar", true}},
|
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{String: "bar", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"single key/value"},
|
"single key/value"},
|
||||||
{pgx.NullHstore{
|
{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{"bar", true}, "baz": pgx.NullString{"quz", true}},
|
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{String: "bar", Valid: true}, "baz": pgx.NullString{String: "quz", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"multiple key/values"},
|
"multiple key/values"},
|
||||||
{pgx.NullHstore{
|
{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"NULL": pgx.NullString{"bar", true}},
|
Hstore: map[string]pgx.NullString{"NULL": pgx.NullString{String: "bar", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
`string "NULL" key`},
|
`string "NULL" key`},
|
||||||
{pgx.NullHstore{
|
{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{"NULL", true}},
|
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{String: "NULL", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
`string "NULL" value`},
|
`string "NULL" value`},
|
||||||
{pgx.NullHstore{
|
{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{"", false}},
|
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{String: "", Valid: false}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
`NULL value`},
|
`NULL value`},
|
||||||
}
|
}
|
||||||
|
@ -120,36 +120,36 @@ func TestNullHstoreTranscode(t *testing.T) {
|
||||||
}
|
}
|
||||||
for _, sst := range specialStringTests {
|
for _, sst := range specialStringTests {
|
||||||
tests = append(tests, test{pgx.NullHstore{
|
tests = append(tests, test{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{sst.input + "foo": pgx.NullString{"bar", true}},
|
Hstore: map[string]pgx.NullString{sst.input + "foo": pgx.NullString{String: "bar", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"key with " + sst.description + " at beginning"})
|
"key with " + sst.description + " at beginning"})
|
||||||
tests = append(tests, test{pgx.NullHstore{
|
tests = append(tests, test{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo" + sst.input + "foo": pgx.NullString{"bar", true}},
|
Hstore: map[string]pgx.NullString{"foo" + sst.input + "foo": pgx.NullString{String: "bar", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"key with " + sst.description + " in middle"})
|
"key with " + sst.description + " in middle"})
|
||||||
tests = append(tests, test{pgx.NullHstore{
|
tests = append(tests, test{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo" + sst.input: pgx.NullString{"bar", true}},
|
Hstore: map[string]pgx.NullString{"foo" + sst.input: pgx.NullString{String: "bar", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"key with " + sst.description + " at end"})
|
"key with " + sst.description + " at end"})
|
||||||
tests = append(tests, test{pgx.NullHstore{
|
tests = append(tests, test{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{sst.input: pgx.NullString{"bar", true}},
|
Hstore: map[string]pgx.NullString{sst.input: pgx.NullString{String: "bar", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"key is " + sst.description})
|
"key is " + sst.description})
|
||||||
|
|
||||||
tests = append(tests, test{pgx.NullHstore{
|
tests = append(tests, test{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{sst.input + "bar", true}},
|
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{String: sst.input + "bar", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"value with " + sst.description + " at beginning"})
|
"value with " + sst.description + " at beginning"})
|
||||||
tests = append(tests, test{pgx.NullHstore{
|
tests = append(tests, test{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{"bar" + sst.input + "bar", true}},
|
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{String: "bar" + sst.input + "bar", Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"value with " + sst.description + " in middle"})
|
"value with " + sst.description + " in middle"})
|
||||||
tests = append(tests, test{pgx.NullHstore{
|
tests = append(tests, test{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{"bar" + sst.input, true}},
|
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{String: "bar" + sst.input, Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"value with " + sst.description + " at end"})
|
"value with " + sst.description + " at end"})
|
||||||
tests = append(tests, test{pgx.NullHstore{
|
tests = append(tests, test{pgx.NullHstore{
|
||||||
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{sst.input, true}},
|
Hstore: map[string]pgx.NullString{"foo": pgx.NullString{String: sst.input, Valid: true}},
|
||||||
Valid: true},
|
Valid: true},
|
||||||
"value is " + sst.description})
|
"value is " + sst.description})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue