Skip to content

Commit

Permalink
Fix ChannelMax type mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
vilius-g committed Mar 6, 2024
1 parent ba3a187 commit de8f134
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type URI struct {
AuthMechanism []string
Heartbeat int
ConnectionTimeout int
ChannelMax int
ChannelMax uint16
}

// ParseURI attempts to parse the given AMQP URI according to the spec.
Expand Down Expand Up @@ -162,11 +162,11 @@ func ParseURI(uri string) (URI, error) {
}

if params.Has("channel_max") {
value, err := strconv.Atoi(params.Get("channel_max"))
value, err := strconv.ParseUint(params.Get("channel_max"), 10, 16)
if err != nil {
return builder, fmt.Errorf("connection_timeout is not an integer: %v", err)
}
builder.ChannelMax = value
builder.ChannelMax = uint16(value)
}

return builder, nil
Expand Down

0 comments on commit de8f134

Please sign in to comment.