Add field labels to struct literals

This commit is contained in:
Cody Soyland 2018-07-19 14:49:50 -05:00
parent 29eba09e1e
commit 23e2961d65
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@ func TestPostIndexRequestUnmarshalJSON(t *testing.T) {
err string
}{
{json: `{"options": {}}`, expected: postIndexRequest{Options: pilosa.IndexOptions{}}},
{json: `{"options": {"keys": true}}`, expected: postIndexRequest{Options: pilosa.IndexOptions{true}}},
{json: `{"options": {"keys": true}}`, expected: postIndexRequest{Options: pilosa.IndexOptions{Keys: true}}},
{json: `{"options": 4}`, err: "options is not map[string]interface{}"},
{json: `{"option": {}}`, err: "Unknown key: option:map[]"},
{json: `{"options": {"badKey": "test"}}`, err: "Unknown key: badKey:test"},

View file

@ -95,7 +95,7 @@ func (i *Index) Options() IndexOptions {
}
func (i *Index) options() IndexOptions {
return IndexOptions{i.keys}
return IndexOptions{Keys: i.keys}
}
// Open opens and initializes the index.