@@ -42,8 +42,8 @@ func TestOptions(t *testing.T) {
42
42
name : "signature option" ,
43
43
opts : []Options {WithRootCertificate ([]byte ("foo" ))},
44
44
want : & options {
45
- RootCertificate : []byte ("foo" ),
46
- ROpt : nil ,
45
+ rootCertificate : []byte ("foo" ),
46
+ rOpt : nil ,
47
47
},
48
48
},
49
49
{
@@ -53,9 +53,9 @@ func TestOptions(t *testing.T) {
53
53
WithKeychain (authn .DefaultKeychain ),
54
54
},
55
55
want : & options {
56
- RootCertificate : nil ,
57
- ROpt : []remote.Option {remote .WithAuthFromKeychain (authn .DefaultKeychain )},
58
- Keychain : authn .DefaultKeychain ,
56
+ rootCertificate : nil ,
57
+ rOpt : []remote.Option {remote .WithAuthFromKeychain (authn .DefaultKeychain )},
58
+ keychain : authn .DefaultKeychain ,
59
59
},
60
60
},
61
61
{
@@ -69,13 +69,13 @@ func TestOptions(t *testing.T) {
69
69
WithKeychain (authn .DefaultKeychain ),
70
70
},
71
71
want : & options {
72
- RootCertificate : nil ,
73
- ROpt : []remote.Option {
72
+ rootCertificate : nil ,
73
+ rOpt : []remote.Option {
74
74
remote .WithAuth (& authn.Basic {Username : "foo" , Password : "bar" }),
75
75
remote .WithAuthFromKeychain (authn .DefaultKeychain ),
76
76
},
77
- Auth : & authn.Basic {Username : "foo" , Password : "bar" },
78
- Keychain : authn .DefaultKeychain ,
77
+ auth : & authn.Basic {Username : "foo" , Password : "bar" },
78
+ keychain : authn .DefaultKeychain ,
79
79
},
80
80
},
81
81
{
@@ -90,62 +90,62 @@ func TestOptions(t *testing.T) {
90
90
WithKeychain (authn .DefaultKeychain ),
91
91
},
92
92
want : & options {
93
- RootCertificate : nil ,
94
- ROpt : []remote.Option {
93
+ rootCertificate : nil ,
94
+ rOpt : []remote.Option {
95
95
remote .WithAuth (& authn.Basic {Username : "foo" , Password : "bar" }),
96
96
remote .WithAuthFromKeychain (authn .DefaultKeychain ),
97
97
remote .WithTransport (http .DefaultTransport ),
98
98
},
99
- Auth : & authn.Basic {Username : "foo" , Password : "bar" },
100
- Keychain : authn .DefaultKeychain ,
99
+ auth : & authn.Basic {Username : "foo" , Password : "bar" },
100
+ keychain : authn .DefaultKeychain ,
101
101
},
102
102
},
103
103
{
104
104
name : "truststore, empty document" ,
105
105
opts : []Options {WithTrustStore (& trustpolicy.Document {})},
106
106
want : & options {
107
- RootCertificate : nil ,
108
- ROpt : nil ,
109
- TrustPolicy : & trustpolicy.Document {},
107
+ rootCertificate : nil ,
108
+ rOpt : nil ,
109
+ trustPolicy : & trustpolicy.Document {},
110
110
},
111
111
},
112
112
{
113
113
name : "truststore, dummy document" ,
114
114
opts : []Options {WithTrustStore (dummyPolicyDocument ())},
115
115
want : & options {
116
- RootCertificate : nil ,
117
- ROpt : nil ,
118
- TrustPolicy : dummyPolicyDocument (),
116
+ rootCertificate : nil ,
117
+ rOpt : nil ,
118
+ trustPolicy : dummyPolicyDocument (),
119
119
},
120
120
},
121
121
{
122
122
name : "insecure, false" ,
123
123
opts : []Options {WithInsecureRegistry (false )},
124
124
want : & options {
125
- RootCertificate : nil ,
126
- ROpt : nil ,
127
- TrustPolicy : nil ,
128
- Insecure : false ,
125
+ rootCertificate : nil ,
126
+ rOpt : nil ,
127
+ trustPolicy : nil ,
128
+ insecure : false ,
129
129
},
130
130
},
131
131
{
132
132
name : "insecure, true" ,
133
133
opts : []Options {WithInsecureRegistry (true )},
134
134
want : & options {
135
- RootCertificate : nil ,
136
- ROpt : nil ,
137
- TrustPolicy : nil ,
138
- Insecure : true ,
135
+ rootCertificate : nil ,
136
+ rOpt : nil ,
137
+ trustPolicy : nil ,
138
+ insecure : true ,
139
139
},
140
140
},
141
141
{
142
142
name : "insecure, default" ,
143
143
opts : []Options {},
144
144
want : & options {
145
- RootCertificate : nil ,
146
- ROpt : nil ,
147
- TrustPolicy : nil ,
148
- Insecure : false ,
145
+ rootCertificate : nil ,
146
+ rOpt : nil ,
147
+ trustPolicy : nil ,
148
+ insecure : false ,
149
149
},
150
150
},
151
151
}
@@ -157,24 +157,24 @@ func TestOptions(t *testing.T) {
157
157
for _ , opt := range tc .opts {
158
158
opt (& o )
159
159
}
160
- if ! reflect .DeepEqual (o .RootCertificate , tc .want .RootCertificate ) {
161
- t .Errorf ("got %#v, want %#v" , & o .RootCertificate , tc .want .RootCertificate )
160
+ if ! reflect .DeepEqual (o .rootCertificate , tc .want .rootCertificate ) {
161
+ t .Errorf ("got %#v, want %#v" , & o .rootCertificate , tc .want .rootCertificate )
162
162
}
163
163
164
- if ! reflect .DeepEqual (o .TrustPolicy , tc .want .TrustPolicy ) {
165
- t .Errorf ("got %#v, want %#v" , & o .TrustPolicy , tc .want .TrustPolicy )
164
+ if ! reflect .DeepEqual (o .trustPolicy , tc .want .trustPolicy ) {
165
+ t .Errorf ("got %#v, want %#v" , & o .trustPolicy , tc .want .trustPolicy )
166
166
}
167
167
168
- if tc .want .ROpt != nil {
169
- if len (o .ROpt ) != len (tc .want .ROpt ) {
170
- t .Errorf ("got %d remote options, want %d" , len (o .ROpt ), len (tc .want .ROpt ))
168
+ if tc .want .rOpt != nil {
169
+ if len (o .rOpt ) != len (tc .want .rOpt ) {
170
+ t .Errorf ("got %d remote options, want %d" , len (o .rOpt ), len (tc .want .rOpt ))
171
171
}
172
172
return
173
173
}
174
174
175
- if tc .want .ROpt == nil {
176
- if len (o .ROpt ) != 0 {
177
- t .Errorf ("got %d remote options, want %d" , len (o .ROpt ), 0 )
175
+ if tc .want .rOpt == nil {
176
+ if len (o .rOpt ) != 0 {
177
+ t .Errorf ("got %d remote options, want %d" , len (o .rOpt ), 0 )
178
178
}
179
179
}
180
180
})
0 commit comments