Problem
internal/syncthing/client.go defines a manual max64 helper:
func max64(a, b int64) int64 {
if a > b {
return a
}
return b
}
Go 1.21 introduced built-in min and max functions that work on all ordered types including int64. This helper is dead weight.
Fix
Delete max64 and replace the two usages with the built-in:
return max(0, curIn-c.baselineIn), max(0, curOut-c.baselineOut), nil
Verify go.mod requires go 1.21 or higher (which it likely does since min() is already used in update.go and server.go).
Problem
internal/syncthing/client.godefines a manualmax64helper:Go 1.21 introduced built-in
minandmaxfunctions that work on all ordered types includingint64. This helper is dead weight.Fix
Delete
max64and replace the two usages with the built-in:Verify
go.modrequiresgo 1.21or higher (which it likely does sincemin()is already used inupdate.goandserver.go).