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
// Range returns the start/end port numbers of a Port range as ints
func (pPort) Range() (int, int, error) {
returnParsePortRangeToInt(p.Port())
}
Suggestion
For consistency and to adhere to the principle of least surprise, it would be beneficial to add a similar comment in the Range function and ignore the error.
The text was updated successfully, but these errors were encountered:
A minor inconsistency in error handling between two functions in the
Port
type.In the
Int
function, there is a comment suggesting that the error should be ignored:go-connections/nat/nat.go
Lines 80 to 87 in fa09c95
However, in the
Range
function, there is no similar comment, and the error is returned, even though the same case applies here:go-connections/nat/nat.go
Lines 89 to 92 in fa09c95
Suggestion
For consistency and to adhere to the principle of least surprise, it would be beneficial to add a similar comment in the
Range
function and ignore the error.The text was updated successfully, but these errors were encountered: