mirror of
https://github.com/1f349/gomvn.git
synced 2024-10-18 09:21:48 +01:00
14 lines
257 B
Go
14 lines
257 B
Go
package routes
|
|
|
|
import (
|
|
"github.com/julienschmidt/httprouter"
|
|
"strconv"
|
|
)
|
|
|
|
func getQueryUserId(params httprouter.Params) (int64, bool) {
|
|
if val, err := strconv.ParseInt(params.ByName("id"), 10, 64); err == nil {
|
|
return val, true
|
|
}
|
|
return 0, false
|
|
}
|