(ctx *gin.Context, name string, f func(id uint))
| 9 | ) |
| 10 | |
| 11 | func withID(ctx *gin.Context, name string, f func(id uint)) { |
| 12 | if id, err := strconv.ParseUint(ctx.Param(name), 10, bits.UintSize); err == nil { |
| 13 | f(uint(id)) |
| 14 | } else { |
| 15 | ctx.AbortWithError(400, errors.New("invalid id")) |
| 16 | } |
| 17 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…