mirror of
https://github.com/gotify/server.git
synced 2026-05-06 21:42:07 +08:00
Use gofmt -s
This commit is contained in:
committed by
Jannis Mattheis
parent
8d7c7a5a50
commit
0f2e7cf5e2
@@ -1,14 +1,15 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func withID(ctx *gin.Context, name string, f func(id uint)) {
|
||||
if id, err := strconv.ParseUint(ctx.Param(name), 10, 32); err == nil {
|
||||
f(uint(id));
|
||||
f(uint(id))
|
||||
} else {
|
||||
ctx.AbortWithError(400, errors.New("invalid id"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user