diff --git a/abi/abi_test.go b/abi/abi_test.go index b4585b6..6c5c963 100644 --- a/abi/abi_test.go +++ b/abi/abi_test.go @@ -314,7 +314,7 @@ func TestSevProduct(t *testing.T) { }, } for _, tc := range tcs { - cpuid = func(op uint32) (uint32, uint32, uint32, uint32) { return tc.eax, 0, 0, 0 } + cpuid = func(uint32) (uint32, uint32, uint32, uint32) { return tc.eax, 0, 0, 0 } got := SevProduct() if diff := cmp.Diff(got, tc.want, protocmp.Transform()); diff != "" { t.Errorf("SevProduct() = %+v, want %+v. Diff: %s", got, tc.want, diff) diff --git a/tools/check/check_test.go b/tools/check/check_test.go index 4ee0f77..f204ff8 100644 --- a/tools/check/check_test.go +++ b/tools/check/check_test.go @@ -143,14 +143,14 @@ func bytesSetter(name string) setterFn { } func stringSetter(name string) setterFn { - return func(p *checkpb.Policy, value string, t *testing.T) bool { + return func(p *checkpb.Policy, value string, _ *testing.T) bool { setField(p, name, value) return false } } func boolSetter(name string) setterFn { - return func(p *checkpb.Policy, value string, t *testing.T) bool { + return func(p *checkpb.Policy, value string, _ *testing.T) bool { switch value { case "true": setField(p, name, true) @@ -165,7 +165,7 @@ func boolSetter(name string) setterFn { } func uint64setter(name string) setterFn { - return func(p *checkpb.Policy, value string, t *testing.T) bool { + return func(p *checkpb.Policy, value string, _ *testing.T) bool { u, err := strconv.ParseUint(value, 10, 64) if err != nil { return true @@ -176,7 +176,7 @@ func uint64setter(name string) setterFn { } func uint32setter(name string) setterFn { - return func(p *checkpb.Policy, value string, t *testing.T) bool { + return func(p *checkpb.Policy, value string, _ *testing.T) bool { u, err := strconv.ParseUint(value, 10, 32) if err != nil { return true @@ -187,7 +187,7 @@ func uint32setter(name string) setterFn { } func uint32valueSetter(name string) setterFn { - return func(p *checkpb.Policy, value string, t *testing.T) bool { + return func(p *checkpb.Policy, value string, _ *testing.T) bool { u, err := strconv.ParseUint(value, 10, 32) if err != nil { return true @@ -198,7 +198,7 @@ func uint32valueSetter(name string) setterFn { } func uint64valueSetter(name string) setterFn { - return func(p *checkpb.Policy, value string, t *testing.T) bool { + return func(p *checkpb.Policy, value string, _ *testing.T) bool { u, err := strconv.ParseUint(value, 10, 64) if err != nil { return true diff --git a/validate/validate_test.go b/validate/validate_test.go index 26a2c18..a8fde2c 100644 --- a/validate/validate_test.go +++ b/validate/validate_test.go @@ -506,7 +506,7 @@ func TestCertTableOptions(t *testing.T) { PlatformInfo: &abi.SnpPlatformInfo{SMTEnabled: true}, CertTableOptions: map[string]*CertEntryOption{ - "00000000-feee-feee-0000-000000000000": {Kind: CertEntryRequire, Validate: func(_ *spb.Attestation, blob []byte) error { return nil }}, + "00000000-feee-feee-0000-000000000000": {Kind: CertEntryRequire, Validate: func(*spb.Attestation, []byte) error { return nil }}, }, }); err == nil || !strings.Contains(err.Error(), "required") { t.Errorf("SnpAttestation(_, &Options{CertTableOptions: require feee-feee}) = %v, want error to contain %s", err, "required") @@ -522,7 +522,7 @@ func TestCertTableOptions(t *testing.T) { } return nil }}, - "00000000-feee-feee-0000-000000000000": {Kind: CertEntryAllowMissing, Validate: func(_ *spb.Attestation, blob []byte) error { return errors.New("don't call me") }}, + "00000000-feee-feee-0000-000000000000": {Kind: CertEntryAllowMissing, Validate: func(*spb.Attestation, []byte) error { return errors.New("don't call me") }}, }, }); err != nil { t.Errorf("SnpAttestation(_, &Options{CertTableOptions: require c0de, allow feee-fee}) = %v, want nil", err) diff --git a/verify/verify_test.go b/verify/verify_test.go index 89372fe..7f450e8 100644 --- a/verify/verify_test.go +++ b/verify/verify_test.go @@ -432,7 +432,7 @@ func TestOpenGetExtendedReportVerifyClose(t *testing.T) { tests := test.TestCases() qp, goodRoots, badRoots, kds := testclient.GetSevQuoteProvider(tests, &test.DeviceOptions{Now: time.Now()}, t) type reportGetter func(sg.QuoteProvider, [64]byte) (*pb.Attestation, error) - reportOnly := func(d sg.QuoteProvider, input [64]byte) (*pb.Attestation, error) { + reportOnly := func(qp sg.QuoteProvider, input [64]byte) (*pb.Attestation, error) { attestation, err := sg.GetQuoteProto(qp, input) if err != nil { return nil, err