// MustParseImports returns a slice of imports.
// If an error occurs during parsing, panic.
191911
func MustParseImports(input string) []*Import {
	parsed, err := ParseImports(input)
	if err != nil {
		panic(err)
	}
	return parsed
}
1085573
func MustParseStatement(s string) Statement {
	stmt, err := ParseStatement(s)
	if err != nil {
		panic(err.Error())
	}
	return stmt
}
928905
func MustParseSchema(rawSchema string) Schema {
	s, err := ParseSchema(rawSchema)
	if err != nil {
		panic(err)
	}
	return s
}
832313
func MustParseSchema(schemaString string, resolver interface{}, opts ...SchemaOpt) *Schema {
	s, err := ParseSchema(schemaString, resolver, opts...)
	if err != nil {
		panic(err)
	}
	return s
}
527253
func addImportsForInterfaceMethods(imports importMap, it reflect.Type) {
	// Handle each method.
	for i := 0; i < it.NumMethod(); i++ {
		m := it.Method(i)
		addImportsForType(imports, m.Type)
	}
}
320718
func MustCompile(rules string, variables map[string]interface{}) (r *Rules) {
	r, err := Compile(rules, variables)
	if err != nil {
		panic(err)
	}
	return
}
387203
func MustParse(s string) int64 {
	i, err := ParseBytesPerKB(s, 0 /*autodetect*/)
	if err != nil {
		panic(err)
	}
	return i
}
610451
func MustParseInt64(s string) (i int64) {
	i, _ = strconv.ParseInt(s, 10, 64)
	return
}
665469
func MustParseRange(s string) Range {
	r, err := ParseRange(s)
	if err != nil {
		panic(`semver: ParseRange(` + s + `): ` + err.Error())
	}
	return r
}
262931
func (c *Configurator) MustRegisterTransport(t TransportSpec) {
	if err := c.RegisterTransport(t); err != nil {
		panic(err)
	}
}
223513
func MustParse(command string, err error) string {
	if err != nil {
		Fatalf("%s, try --help", err)
	}
	return command
}
1356791
func MustParsePortRange(portRange string) PortRange {
	portrange, err := ParsePortRange(portRange)
	if err != nil {
		panic(err)
	}
	return portrange
}
1222928
func (b *Bundle) MustParseMessageFileBytes(buf []byte, path string) {
	if _, err := b.ParseMessageFileBytes(buf, path); err != nil {
		panic(err)
	}
}
1048772
func IsInImports(imports []*ast.ImportSpec, unfoundvar string) bool {

	for _, v := range imports {
		ab := strings.Split(strings.Replace(v.Path.Value, "\"", "", 2), "/")
		if ab[len(ab)-1] == unfoundvar {
			return true
		}

	}

	return false
}
1282582
func Must(def Definition, err error) Definition {
	if err != nil {
		panic(err)
	}
	return def
}
71155
func (p *protocol) ParsePorts(v buffer.View) (src, dst uint16, err *tcpip.Error) {
	switch p.number {
	case ProtocolNumber4:
		return 0, binary.BigEndian.Uint16(v[header.ICMPv4MinimumSize:]), nil
	case ProtocolNumber6:
		return 0, binary.BigEndian.Uint16(v[header.ICMPv6MinimumSize:]), nil
	}
	panic(fmt.Sprint("unknown protocol number: ", p.number))
}
998438
func MustParse(s string) *Query {
	q, err := New(s)
	if err != nil {
		panic(fmt.Sprintf("failed to parse %s: %v", s, err))
	}
	return q
}