You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original code is
// Don't refresh more than twice per minute.
delay := 30 * time.Second
// Don't spend more than ~2% of the time refreshing.
if adaptive := 50 * t.duration; adaptive > delay {
delay = adaptive
}
and it says 'if statement can be modernized using max', pointing to 'adaptive > delay'. For the above code it substitutes
// Don't refresh more than twice per minute.
delay := max(adaptive, delay)
which is syntactically (neither delay not adaptive have been defined) and semantically wrong.
The text was updated successfully, but these errors were encountered:
gopherbot
added
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls
Issues related to the Go language server, gopls.
labels
Jan 3, 2025
The original code is
// Don't refresh more than twice per minute.
delay := 30 * time.Second
// Don't spend more than ~2% of the time refreshing.
if adaptive := 50 * t.duration; adaptive > delay {
delay = adaptive
}
and it says 'if statement can be modernized using max', pointing to 'adaptive > delay'. For the above code it substitutes
// Don't refresh more than twice per minute.
delay := max(adaptive, delay)
which is syntactically (neither delay not adaptive have been defined) and semantically wrong.
The text was updated successfully, but these errors were encountered: