Skip to content

Commit

Permalink
Lint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
deeglaze committed Feb 18, 2024
1 parent 52fc5cb commit 8ab0c25
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions tools/check/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions validate/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion verify/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ab0c25

Please sign in to comment.