diff --git a/.golangci.yml b/.golangci.yml index 4fdb1228b..6e8bf3c86 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,7 +11,5 @@ linters: - gofmt - govet - gosimple - - structcheck - - varcheck - unused - typecheck diff --git a/client/client.go b/client/client.go index 188d8a8a8..2f40092f2 100644 --- a/client/client.go +++ b/client/client.go @@ -674,6 +674,7 @@ func (c *Client) downloadMetaFromTimestamp(name string, m data.TimestampFileMeta } // decodeRoot decodes and verifies root metadata. +//lint:ignore U1000 unused func (c *Client) decodeRoot(b json.RawMessage) error { root := &data.Root{} if err := c.db.Unmarshal(b, root, "root", c.rootVer); err != nil { diff --git a/repo_test.go b/repo_test.go index 59b4b4e19..906b5999c 100644 --- a/repo_test.go +++ b/repo_test.go @@ -2684,7 +2684,7 @@ func (rs *RepoSuite) TestTargetMetadataLength(c *C) { } s := &data.Signed{} c.Assert(json.Unmarshal(targetsJSON, s), IsNil) - fmt.Fprintf(os.Stderr, string(s.Signed)) + fmt.Fprint(os.Stderr, s.Signed) var objMap map[string]json.RawMessage c.Assert(json.Unmarshal(s.Signed, &objMap), IsNil) targetsMap, ok := objMap["targets"] @@ -2697,8 +2697,11 @@ func (rs *RepoSuite) TestTargetMetadataLength(c *C) { c.Fatal("missing foo.txt in targets") } c.Assert(json.Unmarshal(targetsMap, &objMap), IsNil) - targetsMap, ok = objMap["length"] + lengthMsg, ok := objMap["length"] if !ok { c.Fatal("missing length field in foo.txt file meta") } + var length int64 + c.Assert(json.Unmarshal(lengthMsg, &length), IsNil) + c.Assert(length, Equals, int64(0)) } diff --git a/verify/db_test.go b/verify/db_test.go index 2e26b3ceb..01d7a3081 100644 --- a/verify/db_test.go +++ b/verify/db_test.go @@ -93,7 +93,6 @@ func TestDelegationsDB(t *testing.T) { // Previously, every key's key ID was the SHA256 of the public key. TAP-12 // allows arbitrary key IDs, with no loss in security. // -// // TAP-12: https://github.com/theupdateframework/taps/blob/master/tap12.md func TestTAP12(t *testing.T) { db := NewDB()