diff options
author | Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> | 2018-10-03 12:12:31 +0200 |
---|---|---|
committer | Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> | 2018-10-04 15:32:19 +0200 |
commit | 0829a126094d40c191aaa61bf503122a29fbe4f6 (patch) | |
tree | 15af6ae83dec6968f510ae182ddef5d65d8da36d /http/client | |
parent | 7ec68b97e1e51450dbc8842549473d4bc98f8b09 (diff) | |
download | boruta-0829a126094d40c191aaa61bf503122a29fbe4f6.tar.gz boruta-0829a126094d40c191aaa61bf503122a29fbe4f6.tar.bz2 boruta-0829a126094d40c191aaa61bf503122a29fbe4f6.zip |
Fix go vet warnings about usage of unkeyed fields
Change-Id: Ie30636704b6311c6223d346aeb89da85f20e2028
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Diffstat (limited to 'http/client')
-rw-r--r-- | http/client/client.go | 2 | ||||
-rw-r--r-- | http/client/client_test.go | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/http/client/client.go b/http/client/client.go index 581dc4f..f7dec56 100644 --- a/http/client/client.go +++ b/http/client/client.go @@ -337,7 +337,7 @@ func (client *BorutaClient) GetWorkerInfo(uuid boruta.WorkerUUID) (boruta.Worker // SetState is intended only for Boruta server administrators. func (client *BorutaClient) SetState(uuid boruta.WorkerUUID, state boruta.WorkerState) error { path := client.url + "workers/" + string(uuid) + "/setstate" - req, err := json.Marshal(&util.WorkerStatePack{state}) + req, err := json.Marshal(&util.WorkerStatePack{WorkerState: state}) if err != nil { return err } diff --git a/http/client/client_test.go b/http/client/client_test.go index ce003a1..8cd76f7 100644 --- a/http/client/client_test.go +++ b/http/client/client_test.go @@ -873,7 +873,7 @@ func TestListWorkers(t *testing.T) { // list all name: prefix + "empty-filter", path: path, - json: string(jsonMustMarshal(util.WorkersFilter{nil, nil})), + json: string(jsonMustMarshal(util.WorkersFilter{Groups: nil, Capabilities: nil})), contentType: contentJSON, status: http.StatusOK, header: allHeader, @@ -970,7 +970,7 @@ func TestSetState(t *testing.T) { // valid name: prefix + "valid", path: path + validUUID + "/setstate", - json: string(jsonMustMarshal(&util.WorkerStatePack{IDLE})), + json: string(jsonMustMarshal(&util.WorkerStatePack{WorkerState: IDLE})), contentType: contentJSON, status: http.StatusNoContent, }, @@ -978,7 +978,7 @@ func TestSetState(t *testing.T) { // invalid UUID name: prefix + "bad-uuid", path: path + invalidID + "/setstate", - json: string(jsonMustMarshal(&util.WorkerStatePack{FAIL})), + json: string(jsonMustMarshal(&util.WorkerStatePack{WorkerState: FAIL})), contentType: contentJSON, status: http.StatusBadRequest, }, |