Abs is a simple absolute value function for ints
(n int)
| 204 | |
| 205 | // Abs is a simple absolute value function for ints |
| 206 | func Abs(n int) int { |
| 207 | if n < 0 { |
| 208 | return -n |
| 209 | } |
| 210 | return n |
| 211 | } |
| 212 | |
| 213 | // StringWidth returns the visual width of a byte array indexed from 0 to n (rune index) |
| 214 | // with a given tabsize |
no outgoing calls
no test coverage detected