//MustUint cast input to uint64 and panic if error
513299
func MustUint(input interface{}) uint64 {
	output, err := Uint(input)
	if err != nil {
		panic(err)
	}
	return output
}
621610
func (g *PCPGauge) MustInc(val float64) {
	if err := g.Inc(val); err != nil {
		panic(err)
	}
}
521525
func asUint(param string) (uint64, error) {
	i, err := strconv.ParseUint(param, 0, 64)
	if err != nil {
		return 0, ErrBadParameter
	}
	return i, nil
}
1009986
func (d *Context) RequireUint(index int) uint {
	return uint(C.duk_require_uint(d.duk_context, C.duk_idx_t(index)))
}
561539
func (d *Context) PushUint(val uint) {
	C.duk_push_uint(d.duk_context, C.duk_uint_t(val))
}
477943
func MustDecode(input string) []byte {
	dec, err := Decode(input)
	if err != nil {
		panic(err)
	}
	return dec
}
1267590
func asUint(param string) uint64 {

	i, err := strconv.ParseUint(param, 0, 64)
	panicIf(err)

	return i
}
200672
func (reader PluginConfigReaderWithError) GetUint(key string, defaultValue uint64) (uint64, error) {
	key = reader.config.registerKey(key)
	if reader.HasValue(key) {
		if strVal, err := reader.config.Settings.String(key); err == nil {
			return tstrings.AtoU64(strVal) // Allow string to number conversion
		}
		return reader.config.Settings.Uint(key)
	}
	return defaultValue, nil
}
1199141
func parseUint(s string, base, bitSize int) (uint64, error) {
	value, err := strconv.ParseUint(s, base, bitSize)
	if err != nil {
		intValue, intErr := strconv.ParseInt(s, base, bitSize)
		// 1. Handle negative values greater than MinInt64 (and)
		// 2. Handle negative values lesser than MinInt64
		if intErr == nil && intValue < 0 {
			return 0, nil
		} else if intErr != nil && intErr.(*strconv.NumError).Err == strconv.ErrRange && intValue < 0 {
			return 0, nil
		}

		return value, err
	}

	return value, nil
}
239970
func (context *BaseContext) GetUInt(
	key string, defaultValue ...uint) uint {
	if value, ok := context.userData[key]; ok {
		if value, ok := value.(uint); ok {
			return value
		}
	}
	if len(defaultValue) > 0 {
		return defaultValue[0]
	}
	return 0
}
654794
func (c *cookies) MustUint32(key string, defaults ...uint32) uint32 {
	ck, err := c.req.Cookie(key)
	if err != nil {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return 0
	}
	v, err := strconv.ParseUint(ck.Value, 10, 32)
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}
	return uint32(v)
}
1191312
func mustParseInt(expr string) (uint, error) {
	num, err := strconv.Atoi(expr)
	if err != nil {
		return 0, fmt.Errorf("Failed to parse int from %s: %s", expr, err)
	}
	if num < 0 {
		return 0, fmt.Errorf("Negative number (%d) not allowed: %s", num, expr)
	}

	return uint(num), nil
}
623802
func (e *Encoder) EncodeUint(n uint64) error {
	if n <= math.MaxInt8 {
		return e.w.WriteByte(byte(n))
	}
	if n <= math.MaxUint8 {
		return e.EncodeUint8(uint8(n))
	}
	if n <= math.MaxUint16 {
		return e.EncodeUint16(uint16(n))
	}
	if n <= math.MaxUint32 {
		return e.EncodeUint32(uint32(n))
	}
	return e.EncodeUint64(uint64(n))
}
224579
func (f *Queries) MustInt64(key string, defaults ...int64) int64 {
	if v, ok := f.Values()[key]; ok {
		i, err := strconv.ParseInt(v[0], 10, 64)
		if err == nil {
			return i
		}
	}
	if len(defaults) > 0 {
		return defaults[0]
	}
	return 0
}
991969
func (ctx *Context) QueryUint(key string, defaults ...uint) uint {
	return (*Queries)(ctx.req).MustUint(key, defaults...)
}
543715
func (r *Reader) MustInt64(name string) int64 {
	i, err := r.readInt64(name)
	if err != nil {
		panic(err)
	}
	return i
}
581345
func (p *Params) MustUint64(key string, defaults ...uint64) uint64 {
	r, err := strconv.ParseUint(p.Get(key), 10, 64)
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}
	return r
}