From f190b8f5a4b5c70ddc1d202ca57412653ca583c9 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Fri, 16 Dec 2016 12:58:24 +0100 Subject: [PATCH] Update vendoring for github.com/matttproud/golang_protobuf_extensions/pbutil --- .../matttproud/golang_protobuf_extensions/pbutil/Makefile | 7 +++++++ .../matttproud/golang_protobuf_extensions/pbutil/decode.go | 2 +- .../matttproud/golang_protobuf_extensions/pbutil/encode.go | 4 ++-- vendor/vendor.json | 5 +++-- 4 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile new file mode 100644 index 00000000..81be2143 --- /dev/null +++ b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile @@ -0,0 +1,7 @@ +all: + +cover: + go test -cover -v -coverprofile=cover.dat ./... + go tool cover -func cover.dat + +.PHONY: cover diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go index 66d9b545..258c0636 100644 --- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go +++ b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go @@ -38,7 +38,7 @@ var errInvalidVarint = errors.New("invalid varint32 encountered") func ReadDelimited(r io.Reader, m proto.Message) (n int, err error) { // Per AbstractParser#parsePartialDelimitedFrom with // CodedInputStream#readRawVarint32. - headerBuf := make([]byte, binary.MaxVarintLen32) + var headerBuf [binary.MaxVarintLen32]byte var bytesRead, varIntBytes int var messageLength uint64 for varIntBytes == 0 { // i.e. no varint has been decoded yet. diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go index 4b76ea9a..8fb59ad2 100644 --- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go +++ b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go @@ -33,8 +33,8 @@ func WriteDelimited(w io.Writer, m proto.Message) (n int, err error) { return 0, err } - buf := make([]byte, binary.MaxVarintLen32) - encodedLength := binary.PutUvarint(buf, uint64(len(buffer))) + var buf [binary.MaxVarintLen32]byte + encodedLength := binary.PutUvarint(buf[:], uint64(len(buffer))) sync, err := w.Write(buf[:encodedLength]) if err != nil { diff --git a/vendor/vendor.json b/vendor/vendor.json index 4b8df960..b827d1b2 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -44,9 +44,10 @@ "revisionTime": "2015-04-13T22:18:30+03:00" }, { + "checksumSHA1": "bKMZjd2wPw13VwoE7mBeSv5djFA=", "path": "github.com/matttproud/golang_protobuf_extensions/pbutil", - "revision": "d0c3fe89de86839aecf2e0579c40ba3bb336a453", - "revisionTime": "2015-10-11T12:25:29+02:00" + "revision": "c12348ce28de40eed0136aa2b644d0ee0650e56c", + "revisionTime": "2016-04-24T11:30:07Z" }, { "path": "github.com/prometheus/client_golang/prometheus",