From 2f8d1f8e42eebe6b4a4b421cc97053dcdb6b7b4c Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Wed, 18 Dec 2019 15:56:46 +0100 Subject: [PATCH] Fix unconvert --- .golangci.yml | 1 - connector/keystone/keystone_test.go | 2 +- storage/etcd/etcd.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d0dcfd9b..89e09982 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -19,7 +19,6 @@ linters: - unparam - golint - goconst - - unconvert - bodyclose - staticcheck - nakedret diff --git a/connector/keystone/keystone_test.go b/connector/keystone/keystone_test.go index d5d65ef1..d8bb0268 100644 --- a/connector/keystone/keystone_test.go +++ b/connector/keystone/keystone_test.go @@ -274,7 +274,7 @@ func TestUseRefreshToken(t *testing.T) { delete(t, token, groupID, groupsURL) expectEquals(t, 1, len(identityRefresh.Groups)) - expectEquals(t, testGroup, string(identityRefresh.Groups[0])) + expectEquals(t, testGroup, identityRefresh.Groups[0]) } func TestUseRefreshTokenUserDeleted(t *testing.T) { diff --git a/storage/etcd/etcd.go b/storage/etcd/etcd.go index d106f443..ee588129 100644 --- a/storage/etcd/etcd.go +++ b/storage/etcd/etcd.go @@ -156,7 +156,7 @@ func (c *conn) UpdateRefreshToken(id string, updater func(old storage.RefreshTok return c.txnUpdate(ctx, keyID(refreshTokenPrefix, id), func(currentValue []byte) ([]byte, error) { var current RefreshToken if len(currentValue) > 0 { - if err := json.Unmarshal([]byte(currentValue), ¤t); err != nil { + if err := json.Unmarshal(currentValue, ¤t); err != nil { return nil, err } }