ax(mining): replace prose comment with usage example on parseVersion
AX Principle 2: comments show HOW with real values, not WHAT the function does (which the signature already says). Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
4b6ca745f5
commit
089da5fc21
1 changed files with 3 additions and 1 deletions
|
|
@ -285,7 +285,9 @@ func (b *BaseMiner) InstallFromURL(url string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// parseVersion parses a version string (e.g., "6.24.0") into a slice of integers for comparison.
|
||||
// a := parseVersion("6.24.0") // [6, 24, 0]
|
||||
// b := parseVersion("5.0.1") // [5, 0, 1]
|
||||
// if compareVersions(a, b) > 0 { /* a is newer */ }
|
||||
func parseVersion(v string) []int {
|
||||
parts := strings.Split(v, ".")
|
||||
intParts := make([]int, len(parts))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue