vendor: Update github.com/gogo/protobuf

Also tweaks the proto definitions:

 - [packed=false] on the block_indexes field to retain compat with
   v0.14.16 and earlier.

 - Uses the vendored protobuf package in include paths.

And, "build.go setup" will install the vendored protoc-gen-gogofast.
This should ensure that a proto rebuild isn't so dependent on whatever
version of the compiler and package the developer has installed...

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3864
This commit is contained in:
Jakob Borg
2017-01-03 00:16:21 +00:00
committed by Audrius Butkevicius
parent 4fb9c143ac
commit 987718baf8
603 changed files with 340684 additions and 62506 deletions

View File

@@ -1,7 +1,7 @@
// Extensions for Protocol Buffers to create more go like structures.
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2013, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
// http://github.com/gogo/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -30,6 +30,7 @@ package test
import (
"bytes"
"encoding/hex"
"encoding/json"
)
@@ -83,16 +84,22 @@ func (uuid *Uuid) Size() int {
}
func (uuid Uuid) MarshalJSON() ([]byte, error) {
return json.Marshal([]byte(uuid))
s := hex.EncodeToString([]byte(uuid))
return json.Marshal(s)
}
func (uuid *Uuid) UnmarshalJSON(data []byte) error {
v := new([]byte)
err := json.Unmarshal(data, v)
var s string
err := json.Unmarshal(data, &s)
if err != nil {
return err
}
return uuid.Unmarshal(*v)
d, err := hex.DecodeString(s)
if err != nil {
return err
}
*uuid = Uuid(d)
return nil
}
func (uuid Uuid) Equal(other Uuid) bool {