Skip to content

Commit

Permalink
Use ParseInt instead of Atoi
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Osman committed Feb 18, 2021
1 parent c917361 commit b8993fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion route/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,9 @@ func getSampleRateFromAttributes(attrs map[string]interface{}) (int, error) {
var err error
switch v := attrs[sampleRateKey].(type) {
case string:
sampleRate, err = strconv.Atoi(v)
var i int64
i, err = strconv.ParseInt(v, 10, 32)
sampleRate = int(i)
case int:
if v > int32MaxValue {
sampleRate = int32MaxValue
Expand Down

0 comments on commit b8993fb

Please sign in to comment.