Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Feb 8, 2025
1 parent 9c0ebc2 commit 3cc3ef2
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 57 deletions.
6 changes: 3 additions & 3 deletions ber/asn1/ber_asn1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ type TestSet struct {

var unmarshalTestData = []struct {
in []byte
out interface{}
out any
}{
{[]byte{0x02, 0x01, 0x42}, newInt(0x42)},
{[]byte{0x05, 0x00}, &RawValue{0, 5, false, false, []byte{}, []byte{0x05, 0x00}}},
Expand Down Expand Up @@ -493,7 +493,7 @@ type RelativeDistinguishedNameSET []AttributeTypeAndValue

type AttributeTypeAndValue struct {
Type ObjectIdentifier
Value interface{}
Value any
}

type Validity struct {
Expand Down Expand Up @@ -926,7 +926,7 @@ func TestUnmarshalInvalidUTF8(t *testing.T) {
func TestMarshalNilValue(t *testing.T) {
nilValueTestData := []interface{}{
nil,
struct{ V interface{} }{},
struct{ V any }{},
}
for i, test := range nilValueTestData {
if _, err := Marshal(test); err == nil {
Expand Down
2 changes: 1 addition & 1 deletion ber/asn1/ber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type TestExplicitIndefinite struct {

var berUnmarshalTestData = []struct {
in []byte
out interface{}
out any
}{
{
[]byte{0x30, 0x80, 0x31, 0x80, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00},
Expand Down
4 changes: 2 additions & 2 deletions ber/asn1/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ type sequence2Test struct {
}

type marshalTest struct {
in interface{}
in any
out string
}

Expand Down Expand Up @@ -293,7 +293,7 @@ func TestMarshal2(t *testing.T) {
}

type marshalWithOptionsTest struct {
in interface{}
in any
out string
options string
}
Expand Down
2 changes: 1 addition & 1 deletion hash/cmac/aes/cmac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var testData = `

// Load test vectors
func loadCMACAESExamples() []cmacAESExample {
var examplesJSON map[string]interface{}
var examplesJSON map[string]any

exampleData := []byte(testData)

Expand Down
2 changes: 1 addition & 1 deletion hash/pmac/aes/pmac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var testPmacData = `

// Load test vectors
func loadPMACAESExamples() []pmacAESExample {
var examplesJSON map[string]interface{}
var examplesJSON map[string]any

exampleData := []byte(testPmacData)

Expand Down
2 changes: 1 addition & 1 deletion hash/pmac/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var testData = `

// Load test vectors
func loadDblExamples() []dblExample {
var examplesJSON map[string]interface{}
var examplesJSON map[string]any

exampleData := []byte(testData)

Expand Down
2 changes: 1 addition & 1 deletion hash/pmac/pmac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ var testPmacData = `

// Load test vectors
func loadPMACAESExamples() []pmacAESExample {
var examplesJSON map[string]interface{}
var examplesJSON map[string]any

exampleData := []byte(testPmacData)

Expand Down
2 changes: 1 addition & 1 deletion mode/eax/eax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (

func TestEAXImplementsAEADInterface(t *testing.T) {
var eaxInstance eax
var aux interface{} = &eaxInstance
var aux any = &eaxInstance
_, ok := aux.(cipher.AEAD)
if !ok {
t.Errorf("Error: EAX does not implement AEAD interface")
Expand Down
2 changes: 1 addition & 1 deletion mode/ocb/ocb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (

func TestOCBImplementsAEADInterface(t *testing.T) {
var ocbInstance ocb
var aux interface{} = &ocbInstance
var aux any = &ocbInstance
_, ok := aux.(cipher.AEAD)
if !ok {
t.Errorf("Error: OCB can't implement AEAD interface")
Expand Down
2 changes: 1 addition & 1 deletion mode/siv/aes/siv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func init() {

// Load test vectors
func loadAESSIVExamples(filename string) []aesSIVExample {
var examplesJSON map[string]interface{}
var examplesJSON map[string]any

exampleData := testData[filename]

Expand Down
2 changes: 1 addition & 1 deletion mode/siv/cipher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func init() {

// Load test vectors
func loadAESSIVExamples(filename string) []aesSIVExample {
var examplesJSON map[string]interface{}
var examplesJSON map[string]any

exampleData := testData[filename]

Expand Down
6 changes: 3 additions & 3 deletions pkcs7/pkcs7.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type PKCS7 struct {
Certificates []*x509.Certificate
CRLs []pkix.CertificateList
Signers []signerInfo
raw interface{}
raw any
}

type contentInfo struct {
Expand Down Expand Up @@ -131,12 +131,12 @@ func (raw rawCertificates) Parse() ([]*x509.Certificate, error) {
// `encoding/asn1`
type Attribute struct {
Type asn1.ObjectIdentifier
Value interface{}
Value any
}

type attributes struct {
types []asn1.ObjectIdentifier
values []interface{}
values []any
}

// Add adds the attribute, maintaining insertion order
Expand Down
74 changes: 37 additions & 37 deletions tool/test/assert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

var (
i interface{}
i any
zeros = []interface{}{
false,
byte(0),
Expand Down Expand Up @@ -95,8 +95,8 @@ type AssertionTesterNonConformingObject struct {

func Test_ObjectsAreEqual(t *testing.T) {
cases := []struct {
expected interface{}
actual interface{}
expected any
actual any
result bool
}{
// cases that are expected to be equal
Expand Down Expand Up @@ -133,8 +133,8 @@ func Test_ObjectsAreEqualValues(t *testing.T) {
now := time.Now()

cases := []struct {
expected interface{}
actual interface{}
expected any
actual any
result bool
}{
{uint32(10), int32(10), true},
Expand Down Expand Up @@ -166,19 +166,19 @@ func Test_ObjectsAreEqualValues(t *testing.T) {
}

type Nested struct {
Exported interface{}
notExported interface{}
Exported any
notExported any
}

type S struct {
Exported1 interface{}
Exported1 any
Exported2 Nested
notExported1 interface{}
notExported1 any
notExported2 Nested
}

type S2 struct {
foo interface{}
foo any
}

type S3 struct {
Expand All @@ -204,8 +204,8 @@ func Test_ObjectsExportedFieldsAreEqual(t *testing.T) {
intValue := 1

cases := []struct {
expected interface{}
actual interface{}
expected any
actual any
result bool
}{
{S{1, Nested{2, 3}, 4, Nested{5, 6}}, S{1, Nested{2, 3}, 4, Nested{5, 6}}, true},
Expand Down Expand Up @@ -278,8 +278,8 @@ func Test_CopyExportedFields(t *testing.T) {
intValue := 1

cases := []struct {
input interface{}
expected interface{}
input any
expected any
}{
{
input: Nested{"a", "b"},
Expand Down Expand Up @@ -378,8 +378,8 @@ func Test_Exactly(t *testing.T) {
c := float32(1)
d := float32(2)
cases := []struct {
expected interface{}
actual interface{}
expected any
actual any
result bool
}{
{a, b, false},
Expand All @@ -404,11 +404,11 @@ func Test_Equal(t *testing.T) {
type myType string

mockT := new(testing.T)
var m map[string]interface{}
var m map[string]any

cases := []struct {
expected interface{}
actual interface{}
expected any
actual any
result bool
remark string
}{
Expand Down Expand Up @@ -446,8 +446,8 @@ func Test_NotEqual(t *testing.T) {
mockT := new(testing.T)

cases := []struct {
expected interface{}
actual interface{}
expected any
actual any
result bool
}{
// cases that are expected not to match
Expand Down Expand Up @@ -485,8 +485,8 @@ func Test_NotEqualValues(t *testing.T) {
mockT := new(testing.T)

cases := []struct {
expected interface{}
actual interface{}
expected any
actual any
result bool
}{
// cases that are expected not to match
Expand Down Expand Up @@ -568,8 +568,8 @@ func Test_samePointers(t *testing.T) {
p := ptr(2)

type args struct {
first interface{}
second interface{}
first any
second any
}
tests := []struct {
name string
Expand Down Expand Up @@ -676,7 +676,7 @@ func Test_Len(t *testing.T) {
ch <- 3

cases := []struct {
v interface{}
v any
l int
expected1234567 string // message when expecting 1234567 items
}{
Expand Down Expand Up @@ -1050,7 +1050,7 @@ func Test_NotPanics(t *testing.T) {

type mockTestingT struct {
errorFmt string
args []interface{}
args []any
}

func (m *mockTestingT) errorString() string {
Expand Down Expand Up @@ -1161,11 +1161,11 @@ func Test_ContainsNotContains(t *testing.T) {
{"j", "k"},
}
simpleMap := map[interface{}]interface{}{"Foo": "Bar"}
var zeroMap map[interface{}]interface{}
var zeroMap map[interface{}]any

cases := []struct {
expected interface{}
actual interface{}
expected any
actual any
result bool
}{
{"Hello World", "Hello", true},
Expand Down Expand Up @@ -1220,8 +1220,8 @@ func Test_ContainsNotContainsFailMessage(t *testing.T) {

cases := []struct {
assertion func(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool
container interface{}
instance interface{}
container any
instance any
expected string
}{
{
Expand Down Expand Up @@ -1286,8 +1286,8 @@ func Test_ContainsNotContainsOnNilValue(t *testing.T) {

func Test_SubsetNotSubset(t *testing.T) {
cases := []struct {
list interface{}
subset interface{}
list any
subset any
result bool
message string
}{
Expand Down Expand Up @@ -1693,8 +1693,8 @@ func Test_ComparisonAssertionFunc(t *testing.T) {

tests := []struct {
name string
expect interface{}
got interface{}
expect any
got any
assertion ComparisonAssertionFunc
}{
{"isType", (*testing.T)(nil), t, IsType},
Expand All @@ -1718,7 +1718,7 @@ func Test_ComparisonAssertionFunc(t *testing.T) {
func Test_ValueAssertionFunc(t *testing.T) {
tests := []struct {
name string
value interface{}
value any
assertion ValueAssertionFunc
}{
{"notNil", true, NotNil},
Expand Down
6 changes: 3 additions & 3 deletions x509/boring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type boringCertificate struct {
parentOrg string
der []byte
cert *Certificate
key interface{}
key any
fipsOK bool
}

Expand Down Expand Up @@ -95,7 +95,7 @@ func testBoringCert(t *testing.T, name string, key interface{}, parent *boringCe
}

var pcert *Certificate
var pkey interface{}
var pkey any
if parent != nil {
pcert = parent.cert
pkey = parent.key
Expand All @@ -104,7 +104,7 @@ func testBoringCert(t *testing.T, name string, key interface{}, parent *boringCe
pkey = key
}

var pub interface{}
var pub any
var desc string
switch k := key.(type) {
case *rsa.PrivateKey:
Expand Down

0 comments on commit 3cc3ef2

Please sign in to comment.