Update vendoring. (#1257)

* Update vendoring.

Update vendoring to latest upstream.

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2019-02-13 14:12:12 +01:00 committed by GitHub
commit dc4c58671d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
257 changed files with 39320 additions and 7619 deletions

View file

@ -19,6 +19,7 @@ import (
"io"
"math"
"strconv"
"strings"
"sync"
"github.com/prometheus/common/model"
@ -43,7 +44,7 @@ const (
var (
bufPool = sync.Pool{
New: func() interface{} {
return bytes.NewBuffer(make([]byte, 0, initialNumBufSize))
return bytes.NewBuffer(make([]byte, 0, initialBufSize))
},
}
numBufPool = sync.Pool{
@ -416,32 +417,17 @@ func writeLabelPairs(
// writeEscapedString replaces '\' by '\\', new line character by '\n', and - if
// includeDoubleQuote is true - '"' by '\"'.
var (
escaper = strings.NewReplacer("\\", `\\`, "\n", `\n`)
quotedEscaper = strings.NewReplacer("\\", `\\`, "\n", `\n`, "\"", `\"`)
)
func writeEscapedString(w enhancedWriter, v string, includeDoubleQuote bool) (int, error) {
var (
written, n int
err error
)
for _, r := range v {
switch r {
case '\\':
n, err = w.WriteString(`\\`)
case '\n':
n, err = w.WriteString(`\n`)
case '"':
if includeDoubleQuote {
n, err = w.WriteString(`\"`)
} else {
n, err = w.WriteRune(r)
}
default:
n, err = w.WriteRune(r)
}
written += n
if err != nil {
return written, err
}
if includeDoubleQuote {
return quotedEscaper.WriteString(w, v)
} else {
return escaper.WriteString(w, v)
}
return written, nil
}
// writeFloat is equivalent to fmt.Fprint with a float64 argument but hardcodes

View file

@ -1,12 +1,12 @@
/*
Copyright (c) 2011, Open Knowledge Foundation Ltd.
All rights reserved.
HTTP Content-Type Autonegotiation.
The functions in this package implement the behaviour specified in
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Copyright (c) 2011, Open Knowledge Foundation Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

View file

@ -21,7 +21,6 @@ import (
)
var (
separator = []byte{0}
// MetricNameRE is a regular expression matching valid metric
// names. Note that the IsValidMetricName function performs the same
// check but faster than a match with this regular expression.

View file

@ -43,7 +43,7 @@ const (
// (1970-01-01 00:00 UTC) excluding leap seconds.
type Time int64
// Interval describes and interval between two timestamps.
// Interval describes an interval between two timestamps.
type Interval struct {
Start, End Time
}