Skip to content

Commit

Permalink
update API doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgoetz committed Nov 21, 2024
1 parent bdb56a4 commit 2a0194d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/semver/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func parseVersion(version string) (*Version, error) {
return newVersion(major, minor, patch), nil
}

// String returns the rootVersion string
// String returns the string representation of the Version instance (e.g. "1.2.3")
func (v *Version) String() string {
return fmt.Sprintf("%d.%d.%d", v.major, v.minor, v.patch)
}
Expand All @@ -58,17 +58,17 @@ func (v *Version) bump(versionPart int) *Version {
}
}

// Major returns the major version part
// Major returns the major version part. For example, for version "1.2.3", the major part is 1
func (v *Version) Major() int {
return v.major
}

// Minor returns the minor version part
// Minor returns the minor version part. For example, for version "1.2.3", the minor part is 2
func (v *Version) Minor() int {
return v.minor
}

// Patch returns the patch version part
// Patch returns the patch version part. For example, for version "1.2.3", the patch part is 3
func (v *Version) Patch() int {
return v.patch
}

0 comments on commit 2a0194d

Please sign in to comment.