-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Enabling Linters highlighted few low hanging Optional Linters that improve colde readability
Originally posted by @yogeshbdeshpande in #45 (comment)
Please fix the following linters:
Error: hashentry.go:213:2: commentFormatting: put a space between // and comment text (gocritic)
//value, err := hex.DecodeString(sVal)
^
Error: evidence_test.go:27:1: The line is 123 characters long, which exceeds the maximum of 120 characters. (lll)
42414438303942312d373033322d343344392d384639342d424631323845354430363144 # "BAD809B1-7032-43D9-8F94-BF128E5D061D"
^
Error: example_test.go:42:1: The line is 534 characters long, which exceeds the maximum of 120 characters. (lll)
// {"tag-id":"example.acme.roadrunner-sw-v1-0-0","tag-version":0,"software-name":"Roadrunner software bundle","software-version":"1.0.0","entity":[{"entity-name":"ACME Ltd","reg-id":"acme.example","role":["tagCreator","softwareCreator","aggregator"]}],"link":[{"href":"example.acme.roadrunner-hw-v1-0-0","rel":"psa-rot-compound"},{"href":"example.acme.roadrunner-sw-bl-v1-0-0","rel":"component"},{"href":"example.acme.roadrunner-sw-prot-v1-0-0","rel":"component"},{"href":"example.acme.roadrunner-sw-arot-v1-0-0","rel":"component"}]}
^
Error: example_test.go:43:1: The line is 594 characters long, which exceeds the maximum of 120 characters. (lll)
//
^
Error: example_test.go:118:1: The line is 879 characters long, which exceeds the maximum of 120 characters. (lll)
//
^
Error: globalattributes.go:8:1: The line is 128 characters long, which exceeds the maximum of 120 characters. (lll)
Lang string cbor:"15,keyasint,omitempty" json:"lang,omitempty" xml:"http://www.w3.org/XML/1998/namespace lang,attr,omitempty"
^
Error: hashentry_test.go:250:1: The line is 125 characters long, which exceeds the maximum of 120 characters. (lll)
val: MustHexDecode(t, "e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75e45b72f5c0c0b572db4d8d3ab7e97f36"),
^
Error: hashentry_test.go:254:1: The line is 157 characters long, which exceeds the maximum of 120 characters. (lll)
val: MustHexDecode(t, "e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75"),
^
Error: hashentry_test.go:266:1: The line is 125 characters long, which exceeds the maximum of 120 characters. (lll)
val: MustHexDecode(t, "e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75e45b72f5c0c0b572db4d8d3ab7e97f36"),
^
Error: hashentry_test.go:270:1: The line is 157 characters long, which exceeds the maximum of 120 characters. (lll)
val: MustHexDecode(t, "e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75"),
^
Error: hashentry_test.go:343:1: The line is 123 characters long, which exceeds the maximum of 120 characters. (lll)
val: MustHexDecode(t, "e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75e45b72f5c0c0b572db4d8d3ab7e97f"),
^
Error: hashentry_test.go:348:1: The line is 155 characters long, which exceeds the maximum of 120 characters. (lll)
val: MustHexDecode(t, "e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d"),
^
Error: hashentry_test.go:363:1: The line is 123 characters long, which exceeds the maximum of 120 characters. (lll)
val: MustHexDecode(t, "e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75e45b72f5c0c0b572db4d8d3ab7e97f"),
^
Error: hashentry_test.go:368:1: The line is 155 characters long, which exceeds the maximum of 120 characters. (lll)
val: MustHexDecode(t, "e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d75e45b72f5c0c0b572db4d8d3ab7e97f368ff74e62347a824decb67a84e5224d"),
^
Error: softwareidentity.go:91:1: The line is 127 characters long, which exceeds the maximum of 120 characters. (lll)
VersionScheme *VersionScheme cbor:"14,keyasint,omitempty" json:"version-scheme,omitempty" xml:"versionScheme,attr,omitempty"
^
Error: softwareidentity_test.go:15:1: The line is 312 characters long, which exceeds the maximum of 120 characters. (lll)
testXML = []byte(<SoftwareIdentity tagId="f432dc99-2e06-434d-b9ad-2b22e35b6fa4" name="Roadrunner software bundle" version="1.0.0"><Entity name="ACME Ltd" regid="acme.example" role="tagCreator softwareCreator"></Entity><Link href="d84fb5e2-d198-49b4-9d65-3a82421bf180" rel="parent"></Link></SoftwareIdentity>)
^
Error: softwareidentity_test.go:213:1: The line is 129 characters long, which exceeds the maximum of 120 characters. (lll)
Href: NewTagID([]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10}).URI(),
^
Error: softwareidentity_test.go:256:1: The line is 127 characters long, which exceeds the maximum of 120 characters. (lll)
6578616d706c652e61636d652e726f616472756e6e65722d73772d626c2d76312d302d30 # "example.acme.roadrunner-sw-bl-v1-0-0"
^
Error: softwareidentity_test.go:262:1: The line is 133 characters long, which exceeds the maximum of 120 characters. (lll)
6578616d706c652e61636d652e726f616472756e6e65722d73772d70726f742d76312d302d30 # "example.acme.roadrunner-sw-prot-v1-0-0"
^
Error: softwareidentity_test.go:268:1: The line is 133 characters long, which exceeds the maximum of 120 characters. (lll)
6578616d706c652e61636d652e726f616472756e6e65722d73772d61726f742d76312d302d30 # "example.acme.roadrunner-sw-arot-v1-0-0"
^
Error: softwareidentity_test.go:274:1: The line is 133 characters long, which exceeds the maximum of 120 characters. (lll)
77736469303a3031303230332d3435303630302d30372d3839306130302d306230633064306531660a30 # swid:01020304-0506-0708-090a-0b0c0d0e0f10
^
Error: softwaremeta.go:17:1: The line is 128 characters long, which exceeds the maximum of 120 characters. (lll)
ActivationStatus string cbor:"43,keyasint,omitempty" json:"activation-status,omitempty" xml:"activationStatus,attr,omitempty"
^
Error: softwaremeta.go:36:1: The line is 131 characters long, which exceeds the maximum of 120 characters. (lll)
ColloquialVersion string cbor:"45,keyasint,omitempty" json:"colloquial-version,omitempty" xml:"colloquialVersion,attr,omitempty"
^
Error: softwaremeta.go:52:1: The line is 149 characters long, which exceeds the maximum of 120 characters. (lll)
EntitlementDataRequired *bool cbor:"48,keyasint,omitempty" json:"entitlement-data-required,omitempty" xml:"entitlementDataRequired,attr,omitempty"
^
Error: softwaremeta.go:64:1: The line is 122 characters long, which exceeds the maximum of 120 characters. (lll)
EntitlementKey string cbor:"49,keyasint,omitempty" json:"entitlement-key,omitempty" xml:"entitlementKey,attr,omitempty"
^
Error: softwaremeta_test.go:61:1: The line is 121 characters long, which exceeds the maximum of 120 characters. (lll)
33353643434231432d413837332d343242302d384431372d464133334635364239463345 # "356CCB1C-A873-42B0-8D17-FA33F56B9F3E"
^
Error: tagid_test.go:290:1: The line is 128 characters long, which exceeds the maximum of 120 characters. (lll)
invalidVariantUUID := uuid.UUID{0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01}
^
Error: roles.go:238:2: Consider pre-allocating v (prealloc)