@@ -240,7 +240,7 @@ func MustParse(v string) *Version {
240
240
// See the Original() method to retrieve the original value. Semantic Versions
241
241
// don't contain a leading v per the spec. Instead it's optional on
242
242
// implementation.
243
- func (v Version ) String () string {
243
+ func (v * Version ) String () string {
244
244
var buf bytes.Buffer
245
245
246
246
fmt .Fprintf (& buf , "%d.%d.%d" , v .major , v .minor , v .patch )
@@ -260,32 +260,32 @@ func (v *Version) Original() string {
260
260
}
261
261
262
262
// Major returns the major version.
263
- func (v Version ) Major () uint64 {
263
+ func (v * Version ) Major () uint64 {
264
264
return v .major
265
265
}
266
266
267
267
// Minor returns the minor version.
268
- func (v Version ) Minor () uint64 {
268
+ func (v * Version ) Minor () uint64 {
269
269
return v .minor
270
270
}
271
271
272
272
// Patch returns the patch version.
273
- func (v Version ) Patch () uint64 {
273
+ func (v * Version ) Patch () uint64 {
274
274
return v .patch
275
275
}
276
276
277
277
// Prerelease returns the pre-release version.
278
- func (v Version ) Prerelease () string {
278
+ func (v * Version ) Prerelease () string {
279
279
return v .pre
280
280
}
281
281
282
282
// Metadata returns the metadata on the version.
283
- func (v Version ) Metadata () string {
283
+ func (v * Version ) Metadata () string {
284
284
return v .metadata
285
285
}
286
286
287
287
// originalVPrefix returns the original 'v' prefix if any.
288
- func (v Version ) originalVPrefix () string {
288
+ func (v * Version ) originalVPrefix () string {
289
289
// Note, only lowercase v is supported as a prefix by the parser.
290
290
if v .original != "" && v .original [:1 ] == "v" {
291
291
return v .original [:1 ]
@@ -298,8 +298,8 @@ func (v Version) originalVPrefix() string {
298
298
// it unsets metadata and prerelease values, increments patch number.
299
299
// If the current version has any of prerelease or metadata information,
300
300
// it unsets both values and keeps current patch value
301
- func (v Version ) IncPatch () Version {
302
- vNext := v
301
+ func (v * Version ) IncPatch () Version {
302
+ vNext := * v
303
303
// according to http://semver.org/#spec-item-9
304
304
// Pre-release versions have a lower precedence than the associated normal version.
305
305
// according to http://semver.org/#spec-item-10
@@ -321,8 +321,8 @@ func (v Version) IncPatch() Version {
321
321
// Increments minor number.
322
322
// Unsets metadata.
323
323
// Unsets prerelease status.
324
- func (v Version ) IncMinor () Version {
325
- vNext := v
324
+ func (v * Version ) IncMinor () Version {
325
+ vNext := * v
326
326
vNext .metadata = ""
327
327
vNext .pre = ""
328
328
vNext .patch = 0
@@ -337,8 +337,8 @@ func (v Version) IncMinor() Version {
337
337
// Increments major number.
338
338
// Unsets metadata.
339
339
// Unsets prerelease status.
340
- func (v Version ) IncMajor () Version {
341
- vNext := v
340
+ func (v * Version ) IncMajor () Version {
341
+ vNext := * v
342
342
vNext .metadata = ""
343
343
vNext .pre = ""
344
344
vNext .patch = 0
@@ -350,8 +350,8 @@ func (v Version) IncMajor() Version {
350
350
351
351
// SetPrerelease defines the prerelease value.
352
352
// Value must not include the required 'hyphen' prefix.
353
- func (v Version ) SetPrerelease (prerelease string ) (Version , error ) {
354
- vNext := v
353
+ func (v * Version ) SetPrerelease (prerelease string ) (Version , error ) {
354
+ vNext := * v
355
355
if len (prerelease ) > 0 {
356
356
if err := validatePrerelease (prerelease ); err != nil {
357
357
return vNext , err
@@ -364,8 +364,8 @@ func (v Version) SetPrerelease(prerelease string) (Version, error) {
364
364
365
365
// SetMetadata defines metadata value.
366
366
// Value must not include the required 'plus' prefix.
367
- func (v Version ) SetMetadata (metadata string ) (Version , error ) {
368
- vNext := v
367
+ func (v * Version ) SetMetadata (metadata string ) (Version , error ) {
368
+ vNext := * v
369
369
if len (metadata ) > 0 {
370
370
if err := validateMetadata (metadata ); err != nil {
371
371
return vNext , err
@@ -466,7 +466,7 @@ func (v *Version) UnmarshalJSON(b []byte) error {
466
466
}
467
467
468
468
// MarshalJSON implements JSON.Marshaler interface.
469
- func (v Version ) MarshalJSON () ([]byte , error ) {
469
+ func (v * Version ) MarshalJSON () ([]byte , error ) {
470
470
return json .Marshal (v .String ())
471
471
}
472
472
@@ -483,7 +483,7 @@ func (v *Version) UnmarshalText(text []byte) error {
483
483
}
484
484
485
485
// MarshalText implements the encoding.TextMarshaler interface.
486
- func (v Version ) MarshalText () ([]byte , error ) {
486
+ func (v * Version ) MarshalText () ([]byte , error ) {
487
487
return []byte (v .String ()), nil
488
488
}
489
489
@@ -505,7 +505,7 @@ func (v *Version) Scan(value interface{}) error {
505
505
}
506
506
507
507
// Value implements the Driver.Valuer interface.
508
- func (v Version ) Value () (driver.Value , error ) {
508
+ func (v * Version ) Value () (driver.Value , error ) {
509
509
return v .String (), nil
510
510
}
511
511
0 commit comments