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) 2015, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
// Copyright (c) 2015, 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
@@ -29,14 +29,11 @@
package command
import (
"fmt"
"go/format"
"io/ioutil"
"os"
"github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/protoc-gen-gogo/generator"
plugin "github.com/gogo/protobuf/protoc-gen-gogo/plugin"
_ "github.com/gogo/protobuf/plugin/grpc"
"strings"
_ "github.com/gogo/protobuf/plugin/compare"
_ "github.com/gogo/protobuf/plugin/defaultcheck"
@@ -51,13 +48,13 @@ import (
_ "github.com/gogo/protobuf/plugin/populate"
_ "github.com/gogo/protobuf/plugin/size"
_ "github.com/gogo/protobuf/plugin/stringer"
"github.com/gogo/protobuf/plugin/testgen"
_ "github.com/gogo/protobuf/plugin/union"
_ "github.com/gogo/protobuf/plugin/unmarshal"
"github.com/gogo/protobuf/plugin/testgen"
"go/format"
"strings"
"github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/protoc-gen-gogo/generator"
_ "github.com/gogo/protobuf/protoc-gen-gogo/grpc"
plugin "github.com/gogo/protobuf/protoc-gen-gogo/plugin"
)
func Read() *plugin.CodeGeneratorRequest {
@@ -77,6 +74,44 @@ func Read() *plugin.CodeGeneratorRequest {
return g.Request
}
// filenameSuffix replaces the .pb.go at the end of each filename.
func GeneratePlugin(req *plugin.CodeGeneratorRequest, p generator.Plugin, filenameSuffix string) *plugin.CodeGeneratorResponse {
g := generator.New()
g.Request = req
if len(g.Request.FileToGenerate) == 0 {
g.Fail("no files to generate")
}
g.CommandLineParameters(g.Request.GetParameter())
g.WrapTypes()
g.SetPackageNames()
g.BuildTypeNameMap()
g.GeneratePlugin(p)
for i := 0; i < len(g.Response.File); i++ {
g.Response.File[i].Name = proto.String(
strings.Replace(*g.Response.File[i].Name, ".pb.go", filenameSuffix, -1),
)
}
if err := goformat(g.Response); err != nil {
g.Error(err)
}
return g.Response
}
func goformat(resp *plugin.CodeGeneratorResponse) error {
for i := 0; i < len(resp.File); i++ {
formatted, err := format.Source([]byte(resp.File[i].GetContent()))
if err != nil {
return fmt.Errorf("go format error: %v", err)
}
fmts := string(formatted)
resp.File[i].Content = &fmts
}
return nil
}
func Generate(req *plugin.CodeGeneratorRequest) *plugin.CodeGeneratorResponse {
// Begin by allocating a generator. The request and response structures are stored there
// so we can do error handling easily - the response structure contains the field to
@@ -95,46 +130,20 @@ func Generate(req *plugin.CodeGeneratorRequest) *plugin.CodeGeneratorResponse {
g.GenerateAllFiles()
gtest := generator.New()
data, err := proto.Marshal(req)
if err != nil {
g.Error(err, "failed to marshal modified proto")
}
if err := proto.Unmarshal(data, gtest.Request); err != nil {
g.Error(err, "parsing modified proto")
if err := goformat(g.Response); err != nil {
g.Error(err)
}
if len(gtest.Request.FileToGenerate) == 0 {
gtest.Fail("no files to generate")
}
testReq := proto.Clone(req).(*plugin.CodeGeneratorRequest)
gtest.CommandLineParameters(gtest.Request.GetParameter())
testResp := GeneratePlugin(testReq, testgen.NewPlugin(), "pb_test.go")
// Create a wrapped version of the Descriptors and EnumDescriptors that
// point to the file that defines them.
gtest.WrapTypes()
gtest.SetPackageNames()
gtest.BuildTypeNameMap()
gtest.GeneratePlugin(testgen.NewPlugin())
for i := 0; i < len(gtest.Response.File); i++ {
if strings.Contains(*gtest.Response.File[i].Content, `//These tests are generated by github.com/gogo/protobuf/plugin/testgen`) {
gtest.Response.File[i].Name = proto.String(strings.Replace(*gtest.Response.File[i].Name, ".pb.go", "pb_test.go", -1))
g.Response.File = append(g.Response.File, gtest.Response.File[i])
for i := 0; i < len(testResp.File); i++ {
if strings.Contains(*testResp.File[i].Content, `//These tests are generated by github.com/gogo/protobuf/plugin/testgen`) {
g.Response.File = append(g.Response.File, testResp.File[i])
}
}
for i := 0; i < len(g.Response.File); i++ {
formatted, err := format.Source([]byte(g.Response.File[i].GetContent()))
if err != nil {
g.Error(err, "go format error")
}
fmts := string(formatted)
g.Response.File[i].Content = &fmts
}
return g.Response
}

View File

@@ -1,7 +1,7 @@
// Extensions for Protocol Buffers to create more go like structures.
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, Vastech SA (PTY) LTD. rights reserved.
// http://github.com/gogo/protobuf/gogoproto
// Copyright (c) 2015, The GoGo Authors. 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

View File

@@ -1,7 +1,7 @@
// Extensions for Protocol Buffers to create more go like structures.
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, Vastech SA (PTY) LTD. rights reserved.
// http://github.com/gogo/protobuf/gogoproto
// Copyright (c) 2015, The GoGo Authors. 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

View File

@@ -1,7 +1,7 @@
// Extensions for Protocol Buffers to create more go like structures.
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
// Copyright (c) 2015, 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
@@ -29,15 +29,17 @@
package vanity
import (
"strings"
"path/filepath"
"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
)
func NotInPackageGoogleProtobuf(file *descriptor.FileDescriptorProto) bool {
return !strings.HasPrefix(file.GetPackage(), "google.protobuf")
func NotGoogleProtobufDescriptorProto(file *descriptor.FileDescriptorProto) bool {
// can not just check if file.GetName() == "google/protobuf/descriptor.proto" because we do not want to assume compile path
_, fileName := filepath.Split(file.GetName())
return !(file.GetPackage() == "google.protobuf" && fileName == "descriptor.proto")
}
func FilterFiles(files []*descriptor.FileDescriptorProto, f func(file *descriptor.FileDescriptorProto) bool) []*descriptor.FileDescriptorProto {
@@ -173,3 +175,7 @@ func TurnOffGoUnrecognizedAll(file *descriptor.FileDescriptorProto) {
func TurnOffGogoImport(file *descriptor.FileDescriptorProto) {
SetBoolFileOption(gogoproto.E_GogoprotoImport, false)(file)
}
func TurnOnCompareAll(file *descriptor.FileDescriptorProto) {
SetBoolFileOption(gogoproto.E_CompareAll, true)(file)
}

View File

@@ -1,7 +1,7 @@
// Extensions for Protocol Buffers to create more go like structures.
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
// Copyright (c) 2015, 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

View File

@@ -1,7 +1,7 @@
// Extensions for Protocol Buffers to create more go like structures.
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, Vastech SA (PTY) LTD. rights reserved.
// http://github.com/gogo/protobuf/gogoproto
// Copyright (c) 2015, The GoGo Authors. 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
@@ -136,3 +136,7 @@ func TurnOffGoExtensionsMap(msg *descriptor.DescriptorProto) {
func TurnOffGoUnrecognized(msg *descriptor.DescriptorProto) {
SetBoolMessageOption(gogoproto.E_GoprotoUnrecognized, false)(msg)
}
func TurnOnCompare(msg *descriptor.DescriptorProto) {
SetBoolMessageOption(gogoproto.E_Compare, true)(msg)
}

46
vendor/github.com/gogo/protobuf/vanity/test/Makefile generated vendored Normal file
View File

@@ -0,0 +1,46 @@
# Protocol Buffers for Go with Gadgets
#
# 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
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
regenerate:
go install github.com/gogo/protobuf/protoc-gen-gogofast
protoc --gogofast_out=./fast/ vanity.proto
protoc --proto_path=../../:../../../../../:../../protobuf/:. --gogofast_out=./fast/ gogovanity.proto
protoc-min-version -version="3.0.0" --proto_path=../../:../../../../../:../../protobuf/:. --gogofast_out=./fast/ proto3.proto
go install github.com/gogo/protobuf/protoc-gen-gogofaster
protoc --gogofaster_out=./faster/ vanity.proto
protoc --proto_path=../../:../../../../../:../../protobuf/:. --gogofaster_out=./faster/ gogovanity.proto
protoc-min-version -version="3.0.0" --proto_path=../../:../../../../../:../../protobuf/:. --gogofaster_out=./faster/ proto3.proto
go install github.com/gogo/protobuf/protoc-gen-gogoslick
protoc --gogoslick_out=./slick/ vanity.proto
protoc --proto_path=../../:../../../../../:../../protobuf/:. --gogoslick_out=./slick/ gogovanity.proto
protoc-min-version -version="3.0.0" --proto_path=../../:../../../../../:../../protobuf/:. --gogoslick_out=./slick/ proto3.proto
test:
go install github.com/gogo/protobuf/protoc-gen-gofast
protoc --gofast_out=./gofast/ vanity.proto
go test ./...

View File

@@ -27,12 +27,14 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type B struct {
String_ *string `protobuf:"bytes,1,opt,name=String,json=string" json:"String,omitempty"`
Int64 *int64 `protobuf:"varint,2,opt,name=Int64,json=int64" json:"Int64,omitempty"`
Int32 *int32 `protobuf:"varint,3,opt,name=Int32,json=int32,def=1234" json:"Int32,omitempty"`
String_ *string `protobuf:"bytes,1,opt,name=String" json:"String,omitempty"`
Int64 *int64 `protobuf:"varint,2,opt,name=Int64" json:"Int64,omitempty"`
Int32 *int32 `protobuf:"varint,3,opt,name=Int32,def=1234" json:"Int32,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
@@ -67,68 +69,68 @@ func (m *B) GetInt32() int32 {
func init() {
proto.RegisterType((*B)(nil), "vanity.B")
}
func (m *B) Marshal() (data []byte, err error) {
func (m *B) Marshal() (dAtA []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return data[:n], nil
return dAtA[:n], nil
}
func (m *B) MarshalTo(data []byte) (int, error) {
func (m *B) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.String_ != nil {
data[i] = 0xa
dAtA[i] = 0xa
i++
i = encodeVarintGogovanity(data, i, uint64(len(*m.String_)))
i += copy(data[i:], *m.String_)
i = encodeVarintGogovanity(dAtA, i, uint64(len(*m.String_)))
i += copy(dAtA[i:], *m.String_)
}
if m.Int64 != nil {
data[i] = 0x10
dAtA[i] = 0x10
i++
i = encodeVarintGogovanity(data, i, uint64(*m.Int64))
i = encodeVarintGogovanity(dAtA, i, uint64(*m.Int64))
}
if m.Int32 != nil {
data[i] = 0x18
dAtA[i] = 0x18
i++
i = encodeVarintGogovanity(data, i, uint64(*m.Int32))
i = encodeVarintGogovanity(dAtA, i, uint64(*m.Int32))
}
if m.XXX_unrecognized != nil {
i += copy(data[i:], m.XXX_unrecognized)
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeFixed64Gogovanity(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
func encodeFixed64Gogovanity(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Gogovanity(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
func encodeFixed32Gogovanity(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintGogovanity(data []byte, offset int, v uint64) int {
func encodeVarintGogovanity(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *B) Size() (n int) {
@@ -163,8 +165,8 @@ func sovGogovanity(x uint64) (n int) {
func sozGogovanity(x uint64) (n int) {
return sovGogovanity(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *B) Unmarshal(data []byte) error {
l := len(data)
func (m *B) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
@@ -176,7 +178,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -204,7 +206,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -219,7 +221,7 @@ func (m *B) Unmarshal(data []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
s := string(data[iNdEx:postIndex])
s := string(dAtA[iNdEx:postIndex])
m.String_ = &s
iNdEx = postIndex
case 2:
@@ -234,7 +236,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
v |= (int64(b) & 0x7F) << shift
if b < 0x80 {
@@ -254,7 +256,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
v |= (int32(b) & 0x7F) << shift
if b < 0x80 {
@@ -264,7 +266,7 @@ func (m *B) Unmarshal(data []byte) error {
m.Int32 = &v
default:
iNdEx = preIndex
skippy, err := skipGogovanity(data[iNdEx:])
skippy, err := skipGogovanity(dAtA[iNdEx:])
if err != nil {
return err
}
@@ -274,7 +276,7 @@ func (m *B) Unmarshal(data []byte) error {
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
@@ -284,8 +286,8 @@ func (m *B) Unmarshal(data []byte) error {
}
return nil
}
func skipGogovanity(data []byte) (n int, err error) {
l := len(data)
func skipGogovanity(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
@@ -296,7 +298,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -314,7 +316,7 @@ func skipGogovanity(data []byte) (n int, err error) {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if data[iNdEx-1] < 0x80 {
if dAtA[iNdEx-1] < 0x80 {
break
}
}
@@ -331,7 +333,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
@@ -354,7 +356,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -365,7 +367,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipGogovanity(data[start:])
next, err := skipGogovanity(dAtA[start:])
if err != nil {
return 0, err
}
@@ -389,6 +391,8 @@ var (
ErrIntOverflowGogovanity = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("gogovanity.proto", fileDescriptorGogovanity) }
var fileDescriptorGogovanity = []byte{
// 157 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0x48, 0xcf, 0x4f, 0xcf,
@@ -396,9 +400,9 @@ var fileDescriptorGogovanity = []byte{
0xa4, 0x74, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, 0x8a, 0xf4,
0xc1, 0xd2, 0x49, 0xa5, 0x69, 0x60, 0x1e, 0x98, 0x03, 0x66, 0x41, 0xb4, 0x29, 0x05, 0x73, 0x31,
0x3a, 0x09, 0xc9, 0x70, 0xb1, 0x05, 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x4b, 0x30, 0x2a, 0x30, 0x6a,
0x70, 0x3a, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x18, 0xc4, 0x56, 0x0c, 0x16, 0x13, 0x12, 0xe1, 0x62,
0xf5, 0xcc, 0x2b, 0x31, 0x33, 0x91, 0x60, 0x02, 0x4a, 0x32, 0x07, 0xb1, 0x66, 0x82, 0x38, 0x42,
0x52, 0x60, 0x51, 0x63, 0x23, 0x09, 0x66, 0xa0, 0x28, 0xab, 0x15, 0x8b, 0xa1, 0x91, 0xb1, 0x09,
0x58, 0xce, 0xd8, 0xc8, 0x89, 0xe7, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x40, 0xfc, 0x00, 0x88, 0x01,
0x01, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x7b, 0xe6, 0xd9, 0xac, 0x00, 0x00, 0x00,
0x70, 0x3a, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x18, 0x04, 0x15, 0x13, 0x12, 0xe1, 0x62, 0xf5, 0xcc,
0x2b, 0x31, 0x33, 0x91, 0x60, 0x52, 0x60, 0xd4, 0x60, 0x0e, 0x82, 0x70, 0x84, 0xa4, 0xc0, 0xa2,
0xc6, 0x46, 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0xac, 0x56, 0x2c, 0x86, 0x46, 0xc6, 0x26, 0x41, 0x10,
0x21, 0x27, 0x9e, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x11,
0x10, 0x00, 0x00, 0xff, 0xff, 0x35, 0x73, 0x31, 0x4a, 0xac, 0x00, 0x00, 0x00,
}

View File

@@ -26,10 +26,12 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type Aproto3 struct {
B string `protobuf:"bytes,1,opt,name=B,json=b,proto3" json:"B,omitempty"`
B string `protobuf:"bytes,1,opt,name=B,proto3" json:"B,omitempty"`
}
func (m *Aproto3) Reset() { *m = Aproto3{} }
@@ -37,58 +39,65 @@ func (m *Aproto3) String() string { return proto.CompactTextString(m)
func (*Aproto3) ProtoMessage() {}
func (*Aproto3) Descriptor() ([]byte, []int) { return fileDescriptorProto3, []int{0} }
func (m *Aproto3) GetB() string {
if m != nil {
return m.B
}
return ""
}
func init() {
proto.RegisterType((*Aproto3)(nil), "vanity.Aproto3")
}
func (m *Aproto3) Marshal() (data []byte, err error) {
func (m *Aproto3) Marshal() (dAtA []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return data[:n], nil
return dAtA[:n], nil
}
func (m *Aproto3) MarshalTo(data []byte) (int, error) {
func (m *Aproto3) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.B) > 0 {
data[i] = 0xa
dAtA[i] = 0xa
i++
i = encodeVarintProto3(data, i, uint64(len(m.B)))
i += copy(data[i:], m.B)
i = encodeVarintProto3(dAtA, i, uint64(len(m.B)))
i += copy(dAtA[i:], m.B)
}
return i, nil
}
func encodeFixed64Proto3(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
func encodeFixed64Proto3(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Proto3(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
func encodeFixed32Proto3(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintProto3(data []byte, offset int, v uint64) int {
func encodeVarintProto3(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *Aproto3) Size() (n int) {
@@ -114,8 +123,8 @@ func sovProto3(x uint64) (n int) {
func sozProto3(x uint64) (n int) {
return sovProto3(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Aproto3) Unmarshal(data []byte) error {
l := len(data)
func (m *Aproto3) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
@@ -127,7 +136,7 @@ func (m *Aproto3) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -155,7 +164,7 @@ func (m *Aproto3) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -170,11 +179,11 @@ func (m *Aproto3) Unmarshal(data []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.B = string(data[iNdEx:postIndex])
m.B = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto3(data[iNdEx:])
skippy, err := skipProto3(dAtA[iNdEx:])
if err != nil {
return err
}
@@ -193,8 +202,8 @@ func (m *Aproto3) Unmarshal(data []byte) error {
}
return nil
}
func skipProto3(data []byte) (n int, err error) {
l := len(data)
func skipProto3(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
@@ -205,7 +214,7 @@ func skipProto3(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -223,7 +232,7 @@ func skipProto3(data []byte) (n int, err error) {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if data[iNdEx-1] < 0x80 {
if dAtA[iNdEx-1] < 0x80 {
break
}
}
@@ -240,7 +249,7 @@ func skipProto3(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
@@ -263,7 +272,7 @@ func skipProto3(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -274,7 +283,7 @@ func skipProto3(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipProto3(data[start:])
next, err := skipProto3(dAtA[start:])
if err != nil {
return 0, err
}
@@ -298,11 +307,14 @@ var (
ErrIntOverflowProto3 = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("proto3.proto", fileDescriptorProto3) }
var fileDescriptorProto3 = []byte{
// 79 bytes of a gzipped FileDescriptorProto
// 82 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x28, 0xca, 0x2f,
0xc9, 0x37, 0xd6, 0x03, 0x53, 0x42, 0x6c, 0x65, 0x89, 0x79, 0x99, 0x25, 0x95, 0x4a, 0xe2, 0x5c,
0xec, 0x8e, 0x10, 0x09, 0x21, 0x1e, 0x2e, 0x46, 0x27, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20,
0xc6, 0x24, 0x27, 0x9e, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x00, 0xf1, 0x03, 0x20, 0x4e, 0x62, 0x83,
0xa8, 0x01, 0x04, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x14, 0x77, 0x86, 0x45, 0x00, 0x00, 0x00,
0x46, 0x27, 0x27, 0x9e, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e,
0x31, 0x89, 0x0d, 0xa2, 0x06, 0x10, 0x00, 0x00, 0xff, 0xff, 0x97, 0x18, 0x92, 0x84, 0x45, 0x00,
0x00, 0x00,
}

View File

@@ -28,11 +28,13 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type A struct {
Strings *string `protobuf:"bytes,1,opt,name=Strings,json=strings" json:"Strings,omitempty"`
Int *int64 `protobuf:"varint,2,req,name=Int,json=int" json:"Int,omitempty"`
Strings *string `protobuf:"bytes,1,opt,name=Strings" json:"Strings,omitempty"`
Int *int64 `protobuf:"varint,2,req,name=Int" json:"Int,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
@@ -58,65 +60,65 @@ func (m *A) GetInt() int64 {
func init() {
proto.RegisterType((*A)(nil), "vanity.A")
}
func (m *A) Marshal() (data []byte, err error) {
func (m *A) Marshal() (dAtA []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return data[:n], nil
return dAtA[:n], nil
}
func (m *A) MarshalTo(data []byte) (int, error) {
func (m *A) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Strings != nil {
data[i] = 0xa
dAtA[i] = 0xa
i++
i = encodeVarintVanity(data, i, uint64(len(*m.Strings)))
i += copy(data[i:], *m.Strings)
i = encodeVarintVanity(dAtA, i, uint64(len(*m.Strings)))
i += copy(dAtA[i:], *m.Strings)
}
if m.Int == nil {
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int")
} else {
data[i] = 0x10
dAtA[i] = 0x10
i++
i = encodeVarintVanity(data, i, uint64(*m.Int))
i = encodeVarintVanity(dAtA, i, uint64(*m.Int))
}
if m.XXX_unrecognized != nil {
i += copy(data[i:], m.XXX_unrecognized)
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeFixed64Vanity(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
func encodeFixed64Vanity(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Vanity(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
func encodeFixed32Vanity(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintVanity(data []byte, offset int, v uint64) int {
func encodeVarintVanity(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *A) Size() (n int) {
@@ -148,9 +150,9 @@ func sovVanity(x uint64) (n int) {
func sozVanity(x uint64) (n int) {
return sovVanity(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *A) Unmarshal(data []byte) error {
func (m *A) Unmarshal(dAtA []byte) error {
var hasFields [1]uint64
l := len(data)
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
@@ -162,7 +164,7 @@ func (m *A) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -190,7 +192,7 @@ func (m *A) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -205,7 +207,7 @@ func (m *A) Unmarshal(data []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
s := string(data[iNdEx:postIndex])
s := string(dAtA[iNdEx:postIndex])
m.Strings = &s
iNdEx = postIndex
case 2:
@@ -220,7 +222,7 @@ func (m *A) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
v |= (int64(b) & 0x7F) << shift
if b < 0x80 {
@@ -231,7 +233,7 @@ func (m *A) Unmarshal(data []byte) error {
hasFields[0] |= uint64(0x00000001)
default:
iNdEx = preIndex
skippy, err := skipVanity(data[iNdEx:])
skippy, err := skipVanity(dAtA[iNdEx:])
if err != nil {
return err
}
@@ -241,7 +243,7 @@ func (m *A) Unmarshal(data []byte) error {
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
@@ -254,8 +256,8 @@ func (m *A) Unmarshal(data []byte) error {
}
return nil
}
func skipVanity(data []byte) (n int, err error) {
l := len(data)
func skipVanity(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
@@ -266,7 +268,7 @@ func skipVanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -284,7 +286,7 @@ func skipVanity(data []byte) (n int, err error) {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if data[iNdEx-1] < 0x80 {
if dAtA[iNdEx-1] < 0x80 {
break
}
}
@@ -301,7 +303,7 @@ func skipVanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
@@ -324,7 +326,7 @@ func skipVanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -335,7 +337,7 @@ func skipVanity(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipVanity(data[start:])
next, err := skipVanity(dAtA[start:])
if err != nil {
return 0, err
}
@@ -359,13 +361,15 @@ var (
ErrIntOverflowVanity = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("vanity.proto", fileDescriptorVanity) }
var fileDescriptorVanity = []byte{
// 98 bytes of a gzipped FileDescriptorProto
// 97 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4b, 0xcc, 0xcb,
0x2c, 0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0x94, 0xf4, 0xb9, 0x18,
0x1d, 0x85, 0x24, 0xb8, 0xd8, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x8b, 0x25, 0x18, 0x15, 0x18,
0x35, 0x38, 0x83, 0xd8, 0x8b, 0x21, 0x5c, 0x21, 0x01, 0x2e, 0x66, 0xcf, 0xbc, 0x12, 0x09, 0x26,
0x05, 0x26, 0x0d, 0xe6, 0x20, 0xe6, 0xcc, 0xbc, 0x12, 0x27, 0x9e, 0x13, 0x8f, 0xe4, 0x18, 0x2f,
0x00, 0xf1, 0x03, 0x20, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x16, 0x19, 0x2a, 0x55, 0x00,
0x00, 0x00,
0x35, 0x38, 0x83, 0x60, 0x5c, 0x21, 0x01, 0x2e, 0x66, 0xcf, 0xbc, 0x12, 0x09, 0x26, 0x05, 0x26,
0x0d, 0xe6, 0x20, 0x10, 0xd3, 0x89, 0xe7, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f,
0x3c, 0x92, 0x63, 0x04, 0x04, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x7a, 0xd7, 0x63, 0x55, 0x00, 0x00,
0x00,
}

View File

@@ -27,12 +27,14 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type B struct {
String_ *string `protobuf:"bytes,1,opt,name=String,json=string" json:"String,omitempty"`
Int64 int64 `protobuf:"varint,2,opt,name=Int64,json=int64" json:"Int64"`
Int32 *int32 `protobuf:"varint,3,opt,name=Int32,json=int32,def=1234" json:"Int32,omitempty"`
String_ *string `protobuf:"bytes,1,opt,name=String" json:"String,omitempty"`
Int64 int64 `protobuf:"varint,2,opt,name=Int64" json:"Int64"`
Int32 *int32 `protobuf:"varint,3,opt,name=Int32,def=1234" json:"Int32,omitempty"`
}
func (m *B) Reset() { *m = B{} }
@@ -66,63 +68,63 @@ func (m *B) GetInt32() int32 {
func init() {
proto.RegisterType((*B)(nil), "vanity.B")
}
func (m *B) Marshal() (data []byte, err error) {
func (m *B) Marshal() (dAtA []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return data[:n], nil
return dAtA[:n], nil
}
func (m *B) MarshalTo(data []byte) (int, error) {
func (m *B) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.String_ != nil {
data[i] = 0xa
dAtA[i] = 0xa
i++
i = encodeVarintGogovanity(data, i, uint64(len(*m.String_)))
i += copy(data[i:], *m.String_)
i = encodeVarintGogovanity(dAtA, i, uint64(len(*m.String_)))
i += copy(dAtA[i:], *m.String_)
}
data[i] = 0x10
dAtA[i] = 0x10
i++
i = encodeVarintGogovanity(data, i, uint64(m.Int64))
i = encodeVarintGogovanity(dAtA, i, uint64(m.Int64))
if m.Int32 != nil {
data[i] = 0x18
dAtA[i] = 0x18
i++
i = encodeVarintGogovanity(data, i, uint64(*m.Int32))
i = encodeVarintGogovanity(dAtA, i, uint64(*m.Int32))
}
return i, nil
}
func encodeFixed64Gogovanity(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
func encodeFixed64Gogovanity(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Gogovanity(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
func encodeFixed32Gogovanity(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintGogovanity(data []byte, offset int, v uint64) int {
func encodeVarintGogovanity(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *B) Size() (n int) {
@@ -152,8 +154,8 @@ func sovGogovanity(x uint64) (n int) {
func sozGogovanity(x uint64) (n int) {
return sovGogovanity(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *B) Unmarshal(data []byte) error {
l := len(data)
func (m *B) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
@@ -165,7 +167,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -193,7 +195,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -208,7 +210,7 @@ func (m *B) Unmarshal(data []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
s := string(data[iNdEx:postIndex])
s := string(dAtA[iNdEx:postIndex])
m.String_ = &s
iNdEx = postIndex
case 2:
@@ -223,7 +225,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
m.Int64 |= (int64(b) & 0x7F) << shift
if b < 0x80 {
@@ -242,7 +244,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
v |= (int32(b) & 0x7F) << shift
if b < 0x80 {
@@ -252,7 +254,7 @@ func (m *B) Unmarshal(data []byte) error {
m.Int32 = &v
default:
iNdEx = preIndex
skippy, err := skipGogovanity(data[iNdEx:])
skippy, err := skipGogovanity(dAtA[iNdEx:])
if err != nil {
return err
}
@@ -271,8 +273,8 @@ func (m *B) Unmarshal(data []byte) error {
}
return nil
}
func skipGogovanity(data []byte) (n int, err error) {
l := len(data)
func skipGogovanity(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
@@ -283,7 +285,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -301,7 +303,7 @@ func skipGogovanity(data []byte) (n int, err error) {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if data[iNdEx-1] < 0x80 {
if dAtA[iNdEx-1] < 0x80 {
break
}
}
@@ -318,7 +320,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
@@ -341,7 +343,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -352,7 +354,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipGogovanity(data[start:])
next, err := skipGogovanity(dAtA[start:])
if err != nil {
return 0, err
}
@@ -376,17 +378,19 @@ var (
ErrIntOverflowGogovanity = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("gogovanity.proto", fileDescriptorGogovanity) }
var fileDescriptorGogovanity = []byte{
// 162 bytes of a gzipped FileDescriptorProto
// 163 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0x48, 0xcf, 0x4f, 0xcf,
0x2f, 0x4b, 0xcc, 0xcb, 0x2c, 0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0,
0xa4, 0x74, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, 0x8a, 0xf4,
0xc1, 0xd2, 0x49, 0xa5, 0x69, 0x60, 0x1e, 0x98, 0x03, 0x66, 0x41, 0xb4, 0x29, 0x45, 0x72, 0x31,
0x3a, 0x09, 0xc9, 0x70, 0xb1, 0x05, 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x4b, 0x30, 0x2a, 0x30, 0x6a,
0x70, 0x3a, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x18, 0xc4, 0x56, 0x0c, 0x16, 0x13, 0x92, 0xe2, 0x62,
0xf5, 0xcc, 0x2b, 0x31, 0x33, 0x91, 0x60, 0x02, 0x4a, 0x32, 0x83, 0x25, 0x19, 0x82, 0x58, 0x33,
0x41, 0x42, 0x50, 0x39, 0x63, 0x23, 0x09, 0x66, 0xa0, 0x1c, 0xab, 0x15, 0x8b, 0xa1, 0x91, 0xb1,
0x09, 0x58, 0xce, 0xd8, 0xc8, 0x49, 0xe0, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x40, 0xfc, 0x00, 0x88,
0x27, 0x3c, 0x96, 0x63, 0x00, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb0, 0xdf, 0x35, 0x69, 0xb6, 0x00,
0x00, 0x00,
0x70, 0x3a, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x18, 0x04, 0x15, 0x13, 0x92, 0xe2, 0x62, 0xf5, 0xcc,
0x2b, 0x31, 0x33, 0x91, 0x60, 0x52, 0x60, 0xd4, 0x60, 0x06, 0x4b, 0x32, 0x04, 0x41, 0x84, 0xa0,
0x72, 0xc6, 0x46, 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0xac, 0x56, 0x2c, 0x86, 0x46, 0xc6, 0x26, 0x41,
0x10, 0x21, 0x27, 0x81, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e,
0x71, 0xc2, 0x63, 0x39, 0x06, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0xde, 0x29, 0x72, 0xb6,
0x00, 0x00, 0x00,
}

View File

@@ -26,10 +26,12 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type Aproto3 struct {
B string `protobuf:"bytes,1,opt,name=B,json=b,proto3" json:"B,omitempty"`
B string `protobuf:"bytes,1,opt,name=B,proto3" json:"B,omitempty"`
}
func (m *Aproto3) Reset() { *m = Aproto3{} }
@@ -37,58 +39,65 @@ func (m *Aproto3) String() string { return proto.CompactTextString(m)
func (*Aproto3) ProtoMessage() {}
func (*Aproto3) Descriptor() ([]byte, []int) { return fileDescriptorProto3, []int{0} }
func (m *Aproto3) GetB() string {
if m != nil {
return m.B
}
return ""
}
func init() {
proto.RegisterType((*Aproto3)(nil), "vanity.Aproto3")
}
func (m *Aproto3) Marshal() (data []byte, err error) {
func (m *Aproto3) Marshal() (dAtA []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return data[:n], nil
return dAtA[:n], nil
}
func (m *Aproto3) MarshalTo(data []byte) (int, error) {
func (m *Aproto3) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.B) > 0 {
data[i] = 0xa
dAtA[i] = 0xa
i++
i = encodeVarintProto3(data, i, uint64(len(m.B)))
i += copy(data[i:], m.B)
i = encodeVarintProto3(dAtA, i, uint64(len(m.B)))
i += copy(dAtA[i:], m.B)
}
return i, nil
}
func encodeFixed64Proto3(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
func encodeFixed64Proto3(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Proto3(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
func encodeFixed32Proto3(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintProto3(data []byte, offset int, v uint64) int {
func encodeVarintProto3(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *Aproto3) Size() (n int) {
@@ -114,8 +123,8 @@ func sovProto3(x uint64) (n int) {
func sozProto3(x uint64) (n int) {
return sovProto3(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Aproto3) Unmarshal(data []byte) error {
l := len(data)
func (m *Aproto3) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
@@ -127,7 +136,7 @@ func (m *Aproto3) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -155,7 +164,7 @@ func (m *Aproto3) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -170,11 +179,11 @@ func (m *Aproto3) Unmarshal(data []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.B = string(data[iNdEx:postIndex])
m.B = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto3(data[iNdEx:])
skippy, err := skipProto3(dAtA[iNdEx:])
if err != nil {
return err
}
@@ -193,8 +202,8 @@ func (m *Aproto3) Unmarshal(data []byte) error {
}
return nil
}
func skipProto3(data []byte) (n int, err error) {
l := len(data)
func skipProto3(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
@@ -205,7 +214,7 @@ func skipProto3(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -223,7 +232,7 @@ func skipProto3(data []byte) (n int, err error) {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if data[iNdEx-1] < 0x80 {
if dAtA[iNdEx-1] < 0x80 {
break
}
}
@@ -240,7 +249,7 @@ func skipProto3(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
@@ -263,7 +272,7 @@ func skipProto3(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -274,7 +283,7 @@ func skipProto3(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipProto3(data[start:])
next, err := skipProto3(dAtA[start:])
if err != nil {
return 0, err
}
@@ -298,12 +307,14 @@ var (
ErrIntOverflowProto3 = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("proto3.proto", fileDescriptorProto3) }
var fileDescriptorProto3 = []byte{
// 83 bytes of a gzipped FileDescriptorProto
// 87 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x28, 0xca, 0x2f,
0xc9, 0x37, 0xd6, 0x03, 0x53, 0x42, 0x6c, 0x65, 0x89, 0x79, 0x99, 0x25, 0x95, 0x4a, 0xe2, 0x5c,
0xec, 0x8e, 0x10, 0x09, 0x21, 0x1e, 0x2e, 0x46, 0x27, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20,
0xc6, 0x24, 0x27, 0x81, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x00, 0xf1, 0x03, 0x20, 0x9e, 0xf0, 0x58,
0x8e, 0x21, 0x89, 0x0d, 0xa2, 0x0e, 0x10, 0x00, 0x00, 0xff, 0xff, 0xdd, 0x77, 0x4a, 0x7c, 0x49,
0x00, 0x00, 0x00,
0x46, 0x27, 0x27, 0x81, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e,
0x71, 0xc2, 0x63, 0x39, 0x86, 0x24, 0x36, 0x88, 0x3a, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x77,
0x21, 0xa3, 0xc0, 0x49, 0x00, 0x00, 0x00,
}

View File

@@ -27,11 +27,13 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type A struct {
Strings string `protobuf:"bytes,1,opt,name=Strings,json=strings" json:"Strings"`
Int int64 `protobuf:"varint,2,req,name=Int,json=int" json:"Int"`
Strings string `protobuf:"bytes,1,opt,name=Strings" json:"Strings"`
Int int64 `protobuf:"varint,2,req,name=Int" json:"Int"`
}
func (m *A) Reset() { *m = A{} }
@@ -56,56 +58,56 @@ func (m *A) GetInt() int64 {
func init() {
proto.RegisterType((*A)(nil), "vanity.A")
}
func (m *A) Marshal() (data []byte, err error) {
func (m *A) Marshal() (dAtA []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return data[:n], nil
return dAtA[:n], nil
}
func (m *A) MarshalTo(data []byte) (int, error) {
func (m *A) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
data[i] = 0xa
dAtA[i] = 0xa
i++
i = encodeVarintVanity(data, i, uint64(len(m.Strings)))
i += copy(data[i:], m.Strings)
data[i] = 0x10
i = encodeVarintVanity(dAtA, i, uint64(len(m.Strings)))
i += copy(dAtA[i:], m.Strings)
dAtA[i] = 0x10
i++
i = encodeVarintVanity(data, i, uint64(m.Int))
i = encodeVarintVanity(dAtA, i, uint64(m.Int))
return i, nil
}
func encodeFixed64Vanity(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
func encodeFixed64Vanity(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Vanity(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
func encodeFixed32Vanity(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintVanity(data []byte, offset int, v uint64) int {
func encodeVarintVanity(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *A) Size() (n int) {
@@ -130,9 +132,9 @@ func sovVanity(x uint64) (n int) {
func sozVanity(x uint64) (n int) {
return sovVanity(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *A) Unmarshal(data []byte) error {
func (m *A) Unmarshal(dAtA []byte) error {
var hasFields [1]uint64
l := len(data)
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
@@ -144,7 +146,7 @@ func (m *A) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -172,7 +174,7 @@ func (m *A) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -187,7 +189,7 @@ func (m *A) Unmarshal(data []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Strings = string(data[iNdEx:postIndex])
m.Strings = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
@@ -201,7 +203,7 @@ func (m *A) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
m.Int |= (int64(b) & 0x7F) << shift
if b < 0x80 {
@@ -211,7 +213,7 @@ func (m *A) Unmarshal(data []byte) error {
hasFields[0] |= uint64(0x00000001)
default:
iNdEx = preIndex
skippy, err := skipVanity(data[iNdEx:])
skippy, err := skipVanity(dAtA[iNdEx:])
if err != nil {
return err
}
@@ -233,8 +235,8 @@ func (m *A) Unmarshal(data []byte) error {
}
return nil
}
func skipVanity(data []byte) (n int, err error) {
l := len(data)
func skipVanity(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
@@ -245,7 +247,7 @@ func skipVanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -263,7 +265,7 @@ func skipVanity(data []byte) (n int, err error) {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if data[iNdEx-1] < 0x80 {
if dAtA[iNdEx-1] < 0x80 {
break
}
}
@@ -280,7 +282,7 @@ func skipVanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
@@ -303,7 +305,7 @@ func skipVanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -314,7 +316,7 @@ func skipVanity(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipVanity(data[start:])
next, err := skipVanity(dAtA[start:])
if err != nil {
return 0, err
}
@@ -338,13 +340,15 @@ var (
ErrIntOverflowVanity = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("vanity.proto", fileDescriptorVanity) }
var fileDescriptorVanity = []byte{
// 110 bytes of a gzipped FileDescriptorProto
// 109 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4b, 0xcc, 0xcb,
0x2c, 0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0x94, 0xac, 0xb9, 0x18,
0x1d, 0x85, 0xe4, 0xb8, 0xd8, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x8b, 0x25, 0x18, 0x15, 0x18,
0x35, 0x38, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x62, 0x2f, 0x86, 0x08, 0x0a, 0x89, 0x71,
0x31, 0x7b, 0xe6, 0x95, 0x48, 0x30, 0x29, 0x30, 0x69, 0x30, 0x43, 0xe5, 0x98, 0x33, 0xf3, 0x4a,
0x9c, 0x04, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0x00, 0xc4, 0x0f, 0x80, 0x78, 0xc2, 0x63, 0x39, 0x06,
0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x35, 0x96, 0x94, 0xc6, 0x65, 0x00, 0x00, 0x00,
0x35, 0x38, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0x09, 0x0a, 0x89, 0x71, 0x31, 0x7b,
0xe6, 0x95, 0x48, 0x30, 0x29, 0x30, 0x69, 0x30, 0x43, 0xe5, 0x40, 0x02, 0x4e, 0x02, 0x27, 0x1e,
0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x80,
0x00, 0x00, 0x00, 0xff, 0xff, 0x56, 0x0d, 0x52, 0xbb, 0x65, 0x00, 0x00, 0x00,
}

View File

@@ -0,0 +1 @@
*.pb.go

View File

@@ -0,0 +1,39 @@
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, 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
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2";
package vanity;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
message B {
optional string String = 1 [(gogoproto.nullable) = true];
optional int64 Int64 = 2;
optional int32 Int32 = 3 [default = 1234];
}

View File

@@ -0,0 +1,35 @@
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, 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
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto3";
package vanity;
message Aproto3 {
string B = 1;
}

View File

@@ -33,12 +33,14 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type B struct {
String_ *string `protobuf:"bytes,1,opt,name=String,json=string" json:"String,omitempty"`
Int64 int64 `protobuf:"varint,2,opt,name=Int64,json=int64" json:"Int64"`
Int32 *int32 `protobuf:"varint,3,opt,name=Int32,json=int32,def=1234" json:"Int32,omitempty"`
String_ *string `protobuf:"bytes,1,opt,name=String" json:"String,omitempty"`
Int64 int64 `protobuf:"varint,2,opt,name=Int64" json:"Int64"`
Int32 *int32 `protobuf:"varint,3,opt,name=Int32,def=1234" json:"Int32,omitempty"`
}
func (m *B) Reset() { *m = B{} }
@@ -143,11 +145,12 @@ func valueToGoStringGogovanity(v interface{}, typ string) string {
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func extensionToGoStringGogovanity(e map[int32]github_com_gogo_protobuf_proto.Extension) string {
func extensionToGoStringGogovanity(m github_com_gogo_protobuf_proto.Message) string {
e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m)
if e == nil {
return "nil"
}
s := "map[int32]proto.Extension{"
s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{"
keys := make([]int, 0, len(e))
for k := range e {
keys = append(keys, int(k))
@@ -157,66 +160,66 @@ func extensionToGoStringGogovanity(e map[int32]github_com_gogo_protobuf_proto.Ex
for _, k := range keys {
ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
}
s += strings.Join(ss, ",") + "}"
s += strings.Join(ss, ",") + "})"
return s
}
func (m *B) Marshal() (data []byte, err error) {
func (m *B) Marshal() (dAtA []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return data[:n], nil
return dAtA[:n], nil
}
func (m *B) MarshalTo(data []byte) (int, error) {
func (m *B) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.String_ != nil {
data[i] = 0xa
dAtA[i] = 0xa
i++
i = encodeVarintGogovanity(data, i, uint64(len(*m.String_)))
i += copy(data[i:], *m.String_)
i = encodeVarintGogovanity(dAtA, i, uint64(len(*m.String_)))
i += copy(dAtA[i:], *m.String_)
}
data[i] = 0x10
dAtA[i] = 0x10
i++
i = encodeVarintGogovanity(data, i, uint64(m.Int64))
i = encodeVarintGogovanity(dAtA, i, uint64(m.Int64))
if m.Int32 != nil {
data[i] = 0x18
dAtA[i] = 0x18
i++
i = encodeVarintGogovanity(data, i, uint64(*m.Int32))
i = encodeVarintGogovanity(dAtA, i, uint64(*m.Int32))
}
return i, nil
}
func encodeFixed64Gogovanity(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
func encodeFixed64Gogovanity(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Gogovanity(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
func encodeFixed32Gogovanity(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintGogovanity(data []byte, offset int, v uint64) int {
func encodeVarintGogovanity(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *B) Size() (n int) {
@@ -266,8 +269,8 @@ func valueToStringGogovanity(v interface{}) string {
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *B) Unmarshal(data []byte) error {
l := len(data)
func (m *B) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
@@ -279,7 +282,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -307,7 +310,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -322,7 +325,7 @@ func (m *B) Unmarshal(data []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
s := string(data[iNdEx:postIndex])
s := string(dAtA[iNdEx:postIndex])
m.String_ = &s
iNdEx = postIndex
case 2:
@@ -337,7 +340,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
m.Int64 |= (int64(b) & 0x7F) << shift
if b < 0x80 {
@@ -356,7 +359,7 @@ func (m *B) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
v |= (int32(b) & 0x7F) << shift
if b < 0x80 {
@@ -366,7 +369,7 @@ func (m *B) Unmarshal(data []byte) error {
m.Int32 = &v
default:
iNdEx = preIndex
skippy, err := skipGogovanity(data[iNdEx:])
skippy, err := skipGogovanity(dAtA[iNdEx:])
if err != nil {
return err
}
@@ -385,8 +388,8 @@ func (m *B) Unmarshal(data []byte) error {
}
return nil
}
func skipGogovanity(data []byte) (n int, err error) {
l := len(data)
func skipGogovanity(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
@@ -397,7 +400,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -415,7 +418,7 @@ func skipGogovanity(data []byte) (n int, err error) {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if data[iNdEx-1] < 0x80 {
if dAtA[iNdEx-1] < 0x80 {
break
}
}
@@ -432,7 +435,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
@@ -455,7 +458,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -466,7 +469,7 @@ func skipGogovanity(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipGogovanity(data[start:])
next, err := skipGogovanity(dAtA[start:])
if err != nil {
return 0, err
}
@@ -490,18 +493,20 @@ var (
ErrIntOverflowGogovanity = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("gogovanity.proto", fileDescriptorGogovanity) }
var fileDescriptorGogovanity = []byte{
// 184 bytes of a gzipped FileDescriptorProto
// 192 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0x48, 0xcf, 0x4f, 0xcf,
0x2f, 0x4b, 0xcc, 0xcb, 0x2c, 0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0,
0xa4, 0x74, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, 0x8a, 0xf4,
0xc1, 0xd2, 0x49, 0xa5, 0x69, 0x60, 0x1e, 0x98, 0x03, 0x66, 0x41, 0xb4, 0x29, 0x45, 0x72, 0x31,
0x3a, 0x09, 0xc9, 0x70, 0xb1, 0x05, 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x4b, 0x30, 0x2a, 0x30, 0x6a,
0x70, 0x3a, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x18, 0xc4, 0x56, 0x0c, 0x16, 0x13, 0x92, 0xe2, 0x62,
0xf5, 0xcc, 0x2b, 0x31, 0x33, 0x91, 0x60, 0x02, 0x4a, 0x32, 0x83, 0x25, 0x19, 0x82, 0x58, 0x33,
0x41, 0x42, 0x50, 0x39, 0x63, 0x23, 0x09, 0x66, 0xa0, 0x1c, 0xab, 0x15, 0x8b, 0xa1, 0x91, 0xb1,
0x09, 0x58, 0xce, 0xd8, 0xc8, 0x49, 0xe7, 0xc2, 0x43, 0x39, 0x86, 0x1b, 0x40, 0xfc, 0xe1, 0xa1,
0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x40, 0x7c, 0x02, 0x88, 0x2f, 0x00, 0xf1, 0x03, 0x20,
0x7e, 0xf1, 0x08, 0x28, 0x07, 0xa4, 0x27, 0x3c, 0x96, 0x63, 0x00, 0x04, 0x00, 0x00, 0xff, 0xff,
0x07, 0xdc, 0x7b, 0x6e, 0xd2, 0x00, 0x00, 0x00,
0x70, 0x3a, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x18, 0x04, 0x15, 0x13, 0x92, 0xe2, 0x62, 0xf5, 0xcc,
0x2b, 0x31, 0x33, 0x91, 0x60, 0x52, 0x60, 0xd4, 0x60, 0x06, 0x4b, 0x32, 0x04, 0x41, 0x84, 0xa0,
0x72, 0xc6, 0x46, 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0xac, 0x56, 0x2c, 0x86, 0x46, 0xc6, 0x26, 0x41,
0x10, 0x21, 0x27, 0x9d, 0x0b, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0xf8, 0xf0, 0x50, 0x8e,
0xb1, 0xe1, 0x91, 0x1c, 0xe3, 0x8a, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24,
0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8b, 0x47, 0x72, 0x0c, 0x1f, 0x1e, 0xc9, 0x31, 0x4e, 0x78,
0x2c, 0xc7, 0x00, 0x08, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x7e, 0xee, 0xf2, 0xd2, 0x00, 0x00, 0x00,
}

View File

@@ -32,16 +32,25 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type Aproto3 struct {
B string `protobuf:"bytes,1,opt,name=B,json=b,proto3" json:"B,omitempty"`
B string `protobuf:"bytes,1,opt,name=B,proto3" json:"B,omitempty"`
}
func (m *Aproto3) Reset() { *m = Aproto3{} }
func (*Aproto3) ProtoMessage() {}
func (*Aproto3) Descriptor() ([]byte, []int) { return fileDescriptorProto3, []int{0} }
func (m *Aproto3) GetB() string {
if m != nil {
return m.B
}
return ""
}
func init() {
proto.RegisterType((*Aproto3)(nil), "vanity.Aproto3")
}
@@ -93,11 +102,12 @@ func valueToGoStringProto3(v interface{}, typ string) string {
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func extensionToGoStringProto3(e map[int32]github_com_gogo_protobuf_proto.Extension) string {
func extensionToGoStringProto3(m github_com_gogo_protobuf_proto.Message) string {
e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m)
if e == nil {
return "nil"
}
s := "map[int32]proto.Extension{"
s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{"
keys := make([]int, 0, len(e))
for k := range e {
keys = append(keys, int(k))
@@ -107,58 +117,58 @@ func extensionToGoStringProto3(e map[int32]github_com_gogo_protobuf_proto.Extens
for _, k := range keys {
ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
}
s += strings.Join(ss, ",") + "}"
s += strings.Join(ss, ",") + "})"
return s
}
func (m *Aproto3) Marshal() (data []byte, err error) {
func (m *Aproto3) Marshal() (dAtA []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return data[:n], nil
return dAtA[:n], nil
}
func (m *Aproto3) MarshalTo(data []byte) (int, error) {
func (m *Aproto3) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.B) > 0 {
data[i] = 0xa
dAtA[i] = 0xa
i++
i = encodeVarintProto3(data, i, uint64(len(m.B)))
i += copy(data[i:], m.B)
i = encodeVarintProto3(dAtA, i, uint64(len(m.B)))
i += copy(dAtA[i:], m.B)
}
return i, nil
}
func encodeFixed64Proto3(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
func encodeFixed64Proto3(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Proto3(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
func encodeFixed32Proto3(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintProto3(data []byte, offset int, v uint64) int {
func encodeVarintProto3(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *Aproto3) Size() (n int) {
@@ -202,8 +212,8 @@ func valueToStringProto3(v interface{}) string {
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *Aproto3) Unmarshal(data []byte) error {
l := len(data)
func (m *Aproto3) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
@@ -215,7 +225,7 @@ func (m *Aproto3) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -243,7 +253,7 @@ func (m *Aproto3) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -258,11 +268,11 @@ func (m *Aproto3) Unmarshal(data []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.B = string(data[iNdEx:postIndex])
m.B = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto3(data[iNdEx:])
skippy, err := skipProto3(dAtA[iNdEx:])
if err != nil {
return err
}
@@ -281,8 +291,8 @@ func (m *Aproto3) Unmarshal(data []byte) error {
}
return nil
}
func skipProto3(data []byte) (n int, err error) {
l := len(data)
func skipProto3(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
@@ -293,7 +303,7 @@ func skipProto3(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -311,7 +321,7 @@ func skipProto3(data []byte) (n int, err error) {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if data[iNdEx-1] < 0x80 {
if dAtA[iNdEx-1] < 0x80 {
break
}
}
@@ -328,7 +338,7 @@ func skipProto3(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
@@ -351,7 +361,7 @@ func skipProto3(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -362,7 +372,7 @@ func skipProto3(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipProto3(data[start:])
next, err := skipProto3(dAtA[start:])
if err != nil {
return 0, err
}
@@ -386,13 +396,16 @@ var (
ErrIntOverflowProto3 = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("proto3.proto", fileDescriptorProto3) }
var fileDescriptorProto3 = []byte{
// 105 bytes of a gzipped FileDescriptorProto
// 116 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x28, 0xca, 0x2f,
0xc9, 0x37, 0xd6, 0x03, 0x53, 0x42, 0x6c, 0x65, 0x89, 0x79, 0x99, 0x25, 0x95, 0x4a, 0xe2, 0x5c,
0xec, 0x8e, 0x10, 0x09, 0x21, 0x1e, 0x2e, 0x46, 0x27, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20,
0xc6, 0x24, 0x27, 0x9d, 0x0b, 0x0f, 0xe5, 0x18, 0x6e, 0x00, 0xf1, 0x87, 0x87, 0x72, 0x8c, 0x0d,
0x8f, 0xe4, 0x18, 0x57, 0x00, 0xf1, 0x09, 0x20, 0xbe, 0x00, 0xc4, 0x0f, 0x80, 0xf8, 0xc5, 0x23,
0xa0, 0x1c, 0x90, 0x9e, 0xf0, 0x58, 0x8e, 0x21, 0x89, 0x0d, 0x62, 0x06, 0x20, 0x00, 0x00, 0xff,
0xff, 0x37, 0xd7, 0x45, 0xf0, 0x65, 0x00, 0x00, 0x00,
0x46, 0x27, 0x27, 0x9d, 0x0b, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0xf8, 0xf0, 0x50, 0x8e,
0xb1, 0xe1, 0x91, 0x1c, 0xe3, 0x8a, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24,
0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8b, 0x47, 0x72, 0x0c, 0x1f, 0x1e, 0xc9, 0x31, 0x4e, 0x78,
0x2c, 0xc7, 0x90, 0xc4, 0x06, 0x31, 0x03, 0x10, 0x00, 0x00, 0xff, 0xff, 0xb1, 0xa0, 0x15, 0x6b,
0x65, 0x00, 0x00, 0x00,
}

View File

@@ -32,11 +32,13 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type A struct {
Strings string `protobuf:"bytes,1,opt,name=Strings,json=strings" json:"Strings"`
Int int64 `protobuf:"varint,2,req,name=Int,json=int" json:"Int"`
Strings string `protobuf:"bytes,1,opt,name=Strings" json:"Strings"`
Int int64 `protobuf:"varint,2,req,name=Int" json:"Int"`
}
func (m *A) Reset() { *m = A{} }
@@ -112,11 +114,12 @@ func valueToGoStringVanity(v interface{}, typ string) string {
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func extensionToGoStringVanity(e map[int32]github_com_gogo_protobuf_proto.Extension) string {
func extensionToGoStringVanity(m github_com_gogo_protobuf_proto.Message) string {
e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m)
if e == nil {
return "nil"
}
s := "map[int32]proto.Extension{"
s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{"
keys := make([]int, 0, len(e))
for k := range e {
keys = append(keys, int(k))
@@ -126,59 +129,59 @@ func extensionToGoStringVanity(e map[int32]github_com_gogo_protobuf_proto.Extens
for _, k := range keys {
ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
}
s += strings.Join(ss, ",") + "}"
s += strings.Join(ss, ",") + "})"
return s
}
func (m *A) Marshal() (data []byte, err error) {
func (m *A) Marshal() (dAtA []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return data[:n], nil
return dAtA[:n], nil
}
func (m *A) MarshalTo(data []byte) (int, error) {
func (m *A) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
data[i] = 0xa
dAtA[i] = 0xa
i++
i = encodeVarintVanity(data, i, uint64(len(m.Strings)))
i += copy(data[i:], m.Strings)
data[i] = 0x10
i = encodeVarintVanity(dAtA, i, uint64(len(m.Strings)))
i += copy(dAtA[i:], m.Strings)
dAtA[i] = 0x10
i++
i = encodeVarintVanity(data, i, uint64(m.Int))
i = encodeVarintVanity(dAtA, i, uint64(m.Int))
return i, nil
}
func encodeFixed64Vanity(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
func encodeFixed64Vanity(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Vanity(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
func encodeFixed32Vanity(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintVanity(data []byte, offset int, v uint64) int {
func encodeVarintVanity(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *A) Size() (n int) {
@@ -222,9 +225,9 @@ func valueToStringVanity(v interface{}) string {
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *A) Unmarshal(data []byte) error {
func (m *A) Unmarshal(dAtA []byte) error {
var hasFields [1]uint64
l := len(data)
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
@@ -236,7 +239,7 @@ func (m *A) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -264,7 +267,7 @@ func (m *A) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -279,7 +282,7 @@ func (m *A) Unmarshal(data []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Strings = string(data[iNdEx:postIndex])
m.Strings = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
@@ -293,7 +296,7 @@ func (m *A) Unmarshal(data []byte) error {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
m.Int |= (int64(b) & 0x7F) << shift
if b < 0x80 {
@@ -303,7 +306,7 @@ func (m *A) Unmarshal(data []byte) error {
hasFields[0] |= uint64(0x00000001)
default:
iNdEx = preIndex
skippy, err := skipVanity(data[iNdEx:])
skippy, err := skipVanity(dAtA[iNdEx:])
if err != nil {
return err
}
@@ -325,8 +328,8 @@ func (m *A) Unmarshal(data []byte) error {
}
return nil
}
func skipVanity(data []byte) (n int, err error) {
l := len(data)
func skipVanity(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
@@ -337,7 +340,7 @@ func skipVanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -355,7 +358,7 @@ func skipVanity(data []byte) (n int, err error) {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if data[iNdEx-1] < 0x80 {
if dAtA[iNdEx-1] < 0x80 {
break
}
}
@@ -372,7 +375,7 @@ func skipVanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
@@ -395,7 +398,7 @@ func skipVanity(data []byte) (n int, err error) {
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := data[iNdEx]
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
@@ -406,7 +409,7 @@ func skipVanity(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipVanity(data[start:])
next, err := skipVanity(dAtA[start:])
if err != nil {
return 0, err
}
@@ -430,15 +433,17 @@ var (
ErrIntOverflowVanity = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("vanity.proto", fileDescriptorVanity) }
var fileDescriptorVanity = []byte{
// 132 bytes of a gzipped FileDescriptorProto
// 138 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4b, 0xcc, 0xcb,
0x2c, 0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0x94, 0xac, 0xb9, 0x18,
0x1d, 0x85, 0xe4, 0xb8, 0xd8, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x8b, 0x25, 0x18, 0x15, 0x18,
0x35, 0x38, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x62, 0x2f, 0x86, 0x08, 0x0a, 0x89, 0x71,
0x31, 0x7b, 0xe6, 0x95, 0x48, 0x30, 0x29, 0x30, 0x69, 0x30, 0x43, 0xe5, 0x98, 0x33, 0xf3, 0x4a,
0x9c, 0x74, 0x2e, 0x3c, 0x94, 0x63, 0xb8, 0x01, 0xc4, 0x1f, 0x1e, 0xca, 0x31, 0x36, 0x3c, 0x92,
0x63, 0x5c, 0x01, 0xc4, 0x27, 0x80, 0xf8, 0x02, 0x10, 0x3f, 0x00, 0xe2, 0x17, 0x8f, 0x80, 0x72,
0x40, 0x7a, 0xc2, 0x63, 0x39, 0x06, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x61, 0xf3, 0x18, 0x78,
0x81, 0x00, 0x00, 0x00,
0x35, 0x38, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0x09, 0x0a, 0x89, 0x71, 0x31, 0x7b,
0xe6, 0x95, 0x48, 0x30, 0x29, 0x30, 0x69, 0x30, 0x43, 0xe5, 0x40, 0x02, 0x4e, 0x3a, 0x17, 0x1e,
0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15,
0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6,
0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0x01, 0x10, 0x00, 0x00,
0xff, 0xff, 0x4d, 0xd9, 0xba, 0x18, 0x81, 0x00, 0x00, 0x00,
}

View File

@@ -0,0 +1,36 @@
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, 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
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2";
package vanity;
message A {
optional string Strings = 1;
required int64 Int = 2;
}

View File

@@ -0,0 +1,93 @@
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, 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
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package test
import (
fast "github.com/gogo/protobuf/vanity/test/fast"
faster "github.com/gogo/protobuf/vanity/test/faster"
slick "github.com/gogo/protobuf/vanity/test/slick"
"testing"
)
func TestFast(t *testing.T) {
_ = (&fast.A{}).Marshal
_ = (&fast.A{}).MarshalTo
_ = (&fast.A{}).Unmarshal
_ = (&fast.A{}).Size
_ = (&fast.B{}).Marshal
_ = (&fast.B{}).MarshalTo
_ = (&fast.B{}).Unmarshal
_ = (&fast.B{}).Size
}
func TestFaster(t *testing.T) {
_ = (&faster.A{}).Marshal
_ = (&faster.A{}).MarshalTo
_ = (&faster.A{}).Unmarshal
_ = (&faster.A{}).Size
_ = (&faster.A{}).Strings == ""
_ = (&faster.B{}).Marshal
_ = (&faster.B{}).MarshalTo
_ = (&faster.B{}).Unmarshal
_ = (&faster.B{}).Size
_ = (&faster.B{}).String_ == nil
_ = (&faster.B{}).Int64 == 0
_ = (&faster.B{}).Int32 == nil
if (&faster.B{}).GetInt32() != 1234 {
t.Fatalf("expected default")
}
}
func TestSlick(t *testing.T) {
_ = (&slick.A{}).Marshal
_ = (&slick.A{}).MarshalTo
_ = (&slick.A{}).Unmarshal
_ = (&slick.A{}).Size
_ = (&slick.A{}).Strings == ""
_ = (&slick.A{}).GoString
_ = (&slick.A{}).String
_ = (&slick.B{}).Marshal
_ = (&slick.B{}).MarshalTo
_ = (&slick.B{}).Unmarshal
_ = (&slick.B{}).Size
_ = (&slick.B{}).String_ == nil
_ = (&slick.B{}).Int64 == 0
_ = (&slick.B{}).Int32 == nil
if (&slick.B{}).GetInt32() != 1234 {
t.Fatalf("expected default")
}
}