MCPcopy Create free account
hub / github.com/Masterminds/semver / SetMetadata

Method SetMetadata

version.go:473–483  ·  view source on GitHub ↗

SetMetadata defines metadata value. Value must not include the required 'plus' prefix.

(metadata string)

Source from the content-addressed store, hash-verified

471// SetMetadata defines metadata value.
472// Value must not include the required 'plus' prefix.
473func (v Version) SetMetadata(metadata string) (Version, error) {
474 vNext := v
475 if len(metadata) > 0 {
476 if err := validateMetadata(metadata); err != nil {
477 return vNext, err
478 }
479 }
480 vNext.metadata = metadata
481 vNext.original = v.originalVPrefix() + "" + vNext.String()
482 return vNext, nil
483}
484
485// LessThan tests if one version is less than another one.
486func (v *Version) LessThan(o *Version) bool {

Callers 1

TestSetMetadataFunction · 0.95

Calls 3

originalVPrefixMethod · 0.95
validateMetadataFunction · 0.85
StringMethod · 0.45

Tested by 1

TestSetMetadataFunction · 0.76