Don't omit history index when the value is 0 (#1545)

This commit is contained in:
Dmitry Shulyak 2019-07-27 08:48:23 +03:00 committed by GitHub
parent acfe9a721c
commit 6f1c2eca12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -44,10 +44,12 @@ func TestBrowsersOrderedNewestFirst(t *testing.T) {
Timestamp: 50, Timestamp: 50,
}, },
{ {
ID: "3", ID: "3",
Name: "third", Name: "third",
Dapp: true, Dapp: true,
Timestamp: 100, Timestamp: 100,
HistoryIndex: 0,
History: []string{"zero"},
}, },
} }
for i := 0; i < len(browsers); i++ { for i := 0; i < len(browsers); i++ {

View File

@ -35,7 +35,7 @@ type Browser struct {
Name string `json:"name"` Name string `json:"name"`
Timestamp uint64 `json:"timestamp"` Timestamp uint64 `json:"timestamp"`
Dapp bool `json:"dapp?"` Dapp bool `json:"dapp?"`
HistoryIndex int `json:"history-index,omitempty"` HistoryIndex int `json:"history-index"`
History []string `json:"history,omitempty"` History []string `json:"history,omitempty"`
} }