Skip to content

Commit

Permalink
feat: add params.Int
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Nov 27, 2023
1 parent 796a731 commit 1709e1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ func (ps Params) ByName(name string) string {
return s
}

func (ps Params) Int(name string) (int, error) {
return strconv.Atoi(ps.ByName(name))
}

func (ps Params) Uint32(name string) (uint32, error) {
n, err := strconv.ParseUint(ps.ByName(name), 10, 32)
return uint32(n), err
Expand Down

0 comments on commit 1709e1d

Please sign in to comment.