@@ -202,9 +202,9 @@ func shaReplacer(old, new *goVersion) func(string) (string, error) {
202
202
}
203
203
}
204
204
205
- func majorVersionReplacer (old , new * goVersion ) func (string ) (string , error ) {
205
+ func majorVersionReplacer (prefix string , old , new * goVersion ) func (string ) (string , error ) {
206
206
return func (out string ) (string , error ) {
207
- return strings .ReplaceAll (out , old .Major (), new .Major ()), nil
207
+ return strings .ReplaceAll (out , prefix + old .Major (), prefix + new .Major ()), nil
208
208
}
209
209
}
210
210
@@ -241,14 +241,15 @@ func replaceMajor(old, current, next *goVersion) error {
241
241
return replace (path ,
242
242
[]func (string ) (string , error ){
243
243
golangVersionReplacer ("GOLANG_VERSION " , old , next ),
244
+ majorVersionReplacer ("quay.io/prometheus/golang-builder:" , old , next ),
244
245
shaReplacer (old , next ),
245
246
},
246
247
)
247
248
}
248
249
return replace (path ,
249
250
[]func (string ) (string , error ){
250
251
golangVersionReplacer ("" , old , next ),
251
- majorVersionReplacer (old , next ),
252
+ majorVersionReplacer ("" , old , next ),
252
253
},
253
254
)
254
255
})
@@ -262,8 +263,8 @@ func replaceMajor(old, current, next *goVersion) error {
262
263
// Update CircleCI.
263
264
err = replace (".circleci/config.yml" ,
264
265
[]func (string ) (string , error ){
265
- majorVersionReplacer (current , next ),
266
- majorVersionReplacer (old , current ),
266
+ majorVersionReplacer ("" , current , next ),
267
+ majorVersionReplacer ("" , old , current ),
267
268
},
268
269
)
269
270
if err != nil {
@@ -273,8 +274,8 @@ func replaceMajor(old, current, next *goVersion) error {
273
274
// Update Makefile.
274
275
err = replace ("Makefile" ,
275
276
[]func (string ) (string , error ){
276
- majorVersionReplacer (current , next ),
277
- majorVersionReplacer (old , current ),
277
+ majorVersionReplacer ("" , current , next ),
278
+ majorVersionReplacer ("" , old , current ),
278
279
},
279
280
)
280
281
if err != nil {
@@ -285,9 +286,9 @@ func replaceMajor(old, current, next *goVersion) error {
285
286
return replace ("README.md" ,
286
287
[]func (string ) (string , error ){
287
288
fullVersionReplacer (current , next ),
288
- majorVersionReplacer (current , next ),
289
+ majorVersionReplacer ("" , current , next ),
289
290
fullVersionReplacer (old , current ),
290
- majorVersionReplacer (old , current ),
291
+ majorVersionReplacer ("" , old , current ),
291
292
},
292
293
)
293
294
}
0 commit comments