forked from toolshed/abra
chore: go mod tidy / vendor / make deps
This commit is contained in:
36
vendor/github.com/evertras/bubble-table/table/calc.go
generated
vendored
Normal file
36
vendor/github.com/evertras/bubble-table/table/calc.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package table
|
||||
|
||||
// Keep compatibility with Go 1.21 by re-declaring min.
|
||||
//
|
||||
//nolint:predeclared
|
||||
func min(x, y int) int {
|
||||
if x < y {
|
||||
return x
|
||||
}
|
||||
|
||||
return y
|
||||
}
|
||||
|
||||
// Keep compatibility with Go 1.21 by re-declaring max.
|
||||
//
|
||||
//nolint:predeclared
|
||||
func max(x, y int) int {
|
||||
if x > y {
|
||||
return x
|
||||
}
|
||||
|
||||
return y
|
||||
}
|
||||
|
||||
// These var names are fine for this little function
|
||||
//
|
||||
//nolint:varnamelen
|
||||
func gcd(x, y int) int {
|
||||
if x == 0 {
|
||||
return y
|
||||
} else if y == 0 {
|
||||
return x
|
||||
}
|
||||
|
||||
return gcd(y%x, x)
|
||||
}
|
||||
Reference in New Issue
Block a user