init push
This commit is contained in:
14
internal/transport/http/handlers/parse.go
Normal file
14
internal/transport/http/handlers/parse.go
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user