// NOTE: keep in sync with string above.
495479
func (e *encodeState) stringBytes(s []byte) int {
	len0 := e.Len()
	e.WriteByte('"')
	start := 0
	for i := 0; i < len(s); {
		if b := s[i]; b < utf8.RuneSelf {
			if b != '\\' && b != '"' {
				if e.canonical || (0x20 <= b && b != '<' && b != '>' && b != '&') {
					i++
					continue
				}
			}
			if start < i {
				e.Write(s[start:i])
			}
			switch b {
			case '\\', '"':
				e.WriteByte('\\')
				e.WriteByte(b)
			case '\n':
				e.WriteByte('\\')
				e.WriteByte('n')
			case '\r':
				e.WriteByte('\\')
				e.WriteByte('r')
			case '\t':
				e.WriteByte('\\')
				e.WriteByte('t')
			default:
				// This encodes bytes < 0x20 except for \n and \r,
				// as well as <, >, and &. The latter are escaped because they
				// can lead to security holes when user-controlled strings
				// are rendered into JSON and served to some browsers.
				e.WriteString(`\u00`)
				e.WriteByte(hex[b>>4])
				e.WriteByte(hex[b&0xF])
			}
			i++
			start = i
			continue
		}
		if e.canonical {
			i++
			continue
		}
		c, size := utf8.DecodeRune(s[i:])
		if c == utf8.RuneError && size == 1 {
			if start < i {
				e.Write(s[start:i])
			}
			e.WriteString(`\ufffd`)
			i += size
			start = i
			continue
		}
		// U+2028 is LINE SEPARATOR.
		// U+2029 is PARAGRAPH SEPARATOR.
		// They are both technically valid characters in JSON strings,
		// but don't work in JSONP, which has to be evaluated as JavaScript,
		// and can lead to security holes there. It is valid JSON to
		// escape them, so we do so unconditionally.
		// See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion.
		if c == '\u2028' || c == '\u2029' {
			if start < i {
				e.Write(s[start:i])
			}
			e.WriteString(`\u202`)
			e.WriteByte(hex[c&0xF])
			i += size
			start = i
			continue
		}
		i += size
	}
	if start < len(s) {
		e.Write(s[start:])
	}
	e.WriteByte('"')
	return e.Len() - len0
}
940058
func (l *ChangeLine) String() string {
	if l.Reference == "" {
		return fmt.Sprintf(
			"  * %s",
			l.Summary,
		)
	}
	return fmt.Sprintf(
		"  * %s (%s)",
		l.Summary,
		l.Reference,
	)
}
896581
func (n *NotExpr) String() string {
	return fmt.Sprintf("%s: %T{Expr: %v}", n.p, n, n.Expr)
}
246511
func (v *structV) String() string {
	res := "{"
	for i, v := range *v {
		if i > 0 {
			res += ", "
		}
		res += v.String()
	}
	return res + "}"
}
790434
func (t *T) NotEqualf(have, unwanted interface{}, spec string, args ...interface{}) {
	prefix := fmt.Sprintf(spec, args...) + ": "
	t.notEqualPrefix_(have, unwanted, prefix)
}
416768
func (l *RWMutexD) String() string {
	output := make([]string, 0)

	// Write locks
	for key, val := range l.wlocks {
		msg := fmt.Sprintf("%d locks requested by %s", val, key)
		output = append(output, msg)
	}

	// Read locks
	for key, val := range l.rlocks {
		msg := fmt.Sprintf("%d read locks requested by %s", val, key)
		output = append(output, msg)
	}

	return strings.Join(output, "\n")
}
463002
func (t SyncerType) String() string {
	switch t {
	case ActiveSync:
		return "ActiveSync"
	case PassiveSync:
		return "PassiveSync"
	default:
		return fmt.Sprintf("unknown sync type %d", t)
	}
}
1266877
func (value Value) String() string {
	result := ""
	catchPanic(func() {
		result = value.string()
	})
	return result
}
225440
func (t *token) String() string {
	if len(t.value) > 10 {
		return fmt.Sprintf("%s (line: %d, column: %d): %.10q...",
			t.t, t.line, t.column, t.value)
	}
	return fmt.Sprintf("%s (line: %d, column: %d): %q",
		t.t, t.line, t.column, t.value)
}
432656
func NotEqual(values ...interface{}) (failureMessage string) {
	if reflect.DeepEqual(values[0], values[1]) {
		failureMessage = fmt.Sprintf("Expected `%v` to not equal `%v`", values[0], values[1])
	}
	return
}
938796
func (v *Function) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [7]string
	i := 0
	fields[i] = fmt.Sprintf("Name: %v", v.Name)
	i++
	fields[i] = fmt.Sprintf("ThriftName: %v", v.ThriftName)
	i++
	fields[i] = fmt.Sprintf("Arguments: %v", v.Arguments)
	i++
	if v.ReturnType != nil {
		fields[i] = fmt.Sprintf("ReturnType: %v", v.ReturnType)
		i++
	}
	if v.Exceptions != nil {
		fields[i] = fmt.Sprintf("Exceptions: %v", v.Exceptions)
		i++
	}
	if v.OneWay != nil {
		fields[i] = fmt.Sprintf("OneWay: %v", *(v.OneWay))
		i++
	}
	if v.Annotations != nil {
		fields[i] = fmt.Sprintf("Annotations: %v", v.Annotations)
		i++
	}

	return fmt.Sprintf("Function{%v}", strings.Join(fields[:i], ", "))
}
65280
func (v Value) String() string {
	switch v.t {
	case reflect.String:
		return v.s
	case reflect.Int:
		return strconv.Itoa(v.i)
	case reflect.Bool:
		return strconv.FormatBool(v.b)
	}

	return ""
}
966563
func (mc *MembershipChanges) String() string {
	return fmt.Sprintf("add %d node(s), remove %d node(s)", len(mc.AddedNodes), len(mc.RemovedNodes))
}
958666
func (d Diff) String() string {
	var lines []string

	for k, values := range d {
		for _, v := range values {
			lines = append(lines, fmt.Sprintf("%s | key: %s", k, v))
		}
	}

	return strings.Join(lines, "\n")
}
279750
func (b Badge) String() string {
	if b.isSet {
		return fmt.Sprintf("set %d", b.number)
	}
	return "preserve"
}
648006
func (primative *Primative) AsString() (string, error) {
	switch val := primative.value.(type) {
	case bool:
		strVal := "False"
		if val {
			strVal = "True"
		}
		return strVal, nil
	case float64:
		return strconv.FormatFloat(val, 10, -1, 64), nil
	case int64:
		return strconv.FormatInt(val, 10), nil
	case nil:
		return "Null", nil
	case string:
		return val, nil
	}

	msg := fmt.Sprintf("Could not convert value %s to type STRING", primative.value)
	return "", errors.New(msg)
}
334114
func (sp *Subscribe) String() string {
	var subscriptions []string

	for _, t := range sp.Subscriptions {
		subscriptions = append(subscriptions, t.String())
	}

	return fmt.Sprintf("<Subscribe ID=%d Subscriptions=[%s]>",
		sp.ID, strings.Join(subscriptions, ", "))
}