15 lines
184 B
Go
15 lines
184 B
Go
package handlers
|
|
|
|
import "strconv"
|
|
|
|
func parseIntDefault(v string, def int) int {
|
|
if v == "" {
|
|
return def
|
|
}
|
|
n, err := strconv.Atoi(v)
|
|
if err != nil {
|
|
return def
|
|
}
|
|
return n
|
|
}
|