From a14352902240269754195388d4ac2faef08e79ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Feb 2023 22:48:02 +0000 Subject: [PATCH] Bump github.com/gin-gonic/gin from 1.7.2 to 1.7.7 Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.7.2 to 1.7.7. - [Release notes](https://github.com/gin-gonic/gin/releases) - [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md) - [Commits](https://github.com/gin-gonic/gin/compare/v1.7.2...v1.7.7) --- updated-dependencies: - dependency-name: github.com/gin-gonic/gin dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- .../github.com/GeertJohan/go.rice/appended.go | 5 - vendor/github.com/GeertJohan/go.rice/box.go | 1 + .../github.com/GeertJohan/go.rice/virtual.go | 4 + vendor/github.com/GeertJohan/go.rice/walk.go | 8 + .../aws/aws-sdk-go/aws/awsutil/path_value.go | 1 + .../aws-sdk-go/aws/client/default_retryer.go | 2 + .../github.com/aws/aws-sdk-go/aws/config.go | 2 + .../aws-sdk-go/aws/corehandlers/handlers.go | 3 +- .../aws-sdk-go/aws/corehandlers/user_agent.go | 6 +- .../aws/credentials/chain_provider.go | 18 +- .../aws/credentials/processcreds/provider.go | 2 + .../shared_credentials_provider.go | 6 +- .../aws/credentials/static_provider.go | 6 +- .../aws/aws-sdk-go/aws/csm/enable.go | 4 +- .../aws/aws-sdk-go/aws/csm/metric_chan.go | 6 +- .../aws-sdk-go/aws/csm/metric_exception.go | 1 - .../aws/aws-sdk-go/aws/csm/reporter.go | 4 +- .../aws/aws-sdk-go/aws/ec2metadata/api.go | 1 + .../aws/ec2metadata/token_provider.go | 2 + .../aws/aws-sdk-go/aws/endpoints/v3model.go | 1 - .../aws/aws-sdk-go/aws/request/request.go | 1 + .../aws/aws-sdk-go/aws/request/retryer.go | 1 + .../aws/request/timeout_read_closer.go | 6 +- .../aws/aws-sdk-go/aws/request/validation.go | 1 + .../aws/aws-sdk-go/aws/request/waiter.go | 1 + .../aws/aws-sdk-go/aws/session/credentials.go | 1 - .../aws/aws-sdk-go/aws/session/session.go | 4 +- .../aws/aws-sdk-go/aws/signer/v4/v4.go | 3 +- .../github.com/aws/aws-sdk-go/aws/url_1_7.go | 1 + .../aws/aws-sdk-go/internal/ini/ini_parser.go | 26 +- .../aws/aws-sdk-go/internal/ini/sep_tokens.go | 4 +- .../internal/s3shared/s3err/error.go | 1 - .../private/protocol/eventstream/debug.go | 1 - .../private/protocol/eventstream/decode.go | 3 - .../private/protocol/eventstream/message.go | 16 +- .../aws/aws-sdk-go/private/protocol/host.go | 3 +- .../private/protocol/json/jsonutil/build.go | 6 +- .../protocol/json/jsonutil/unmarshal.go | 1 + .../aws-sdk-go/private/protocol/rest/build.go | 1 + .../private/protocol/rest/unmarshal.go | 1 + .../aws-sdk-go/private/protocol/timestamp.go | 2 +- .../aws/aws-sdk-go/service/s3/api.go | 2 +- .../aws/aws-sdk-go/service/s3/endpoint.go | 2 +- .../aws-sdk-go/service/s3/endpoint_builder.go | 1 + .../service/s3/host_style_bucket.go | 10 +- .../bmclib/providers/dell/idrac9/model.go | 6 +- .../bmclib/providers/hp/c7000/configure.go | 6 +- .../providers/hp/c7000/setupConnections.go | 2 +- .../bmc-toolbox/gin-go-metrics/helpers.go | 3 +- .../bmc-toolbox/gin-go-metrics/metrics.go | 55 ++-- .../gin-go-metrics/middleware/middleware.go | 4 +- .../github.com/bombsimon/logrusr/logrusr.go | 2 +- .../go-metrics-graphite/graphite.go | 2 +- vendor/github.com/fsnotify/fsnotify/kqueue.go | 3 +- .../github.com/fsnotify/fsnotify/windows.go | 6 +- .../github.com/gin-contrib/sse/sse-decoder.go | 4 +- .../github.com/gin-contrib/sse/sse-encoder.go | 6 +- vendor/github.com/gin-gonic/gin/.travis.yml | 2 - vendor/github.com/gin-gonic/gin/CHANGELOG.md | 36 +++ vendor/github.com/gin-gonic/gin/README.md | 43 ++- .../github.com/gin-gonic/gin/binding/form.go | 8 +- .../gin-gonic/gin/binding/form_mapping.go | 3 +- .../gin-gonic/gin/binding/header.go | 1 + .../github.com/gin-gonic/gin/binding/xml.go | 1 - vendor/github.com/gin-gonic/gin/context.go | 66 ++-- .../gin-gonic/gin/context_appengine.go | 2 +- vendor/github.com/gin-gonic/gin/debug.go | 4 +- vendor/github.com/gin-gonic/gin/gin.go | 126 ++++++-- vendor/github.com/gin-gonic/gin/go.mod | 2 + vendor/github.com/gin-gonic/gin/mode.go | 6 +- vendor/github.com/gin-gonic/gin/recovery.go | 2 +- .../github.com/gin-gonic/gin/render/html.go | 1 - .../github.com/gin-gonic/gin/render/json.go | 8 +- .../gin-gonic/gin/render/msgpack.go | 4 +- vendor/github.com/gin-gonic/gin/tree.go | 107 +++++-- vendor/github.com/gin-gonic/gin/version.go | 2 +- vendor/github.com/go-logr/zapr/zapr.go | 6 +- .../github.com/go-playground/locales/rules.go | 5 + .../universal-translator/errors.go | 20 +- .../universal-translator/import_export.go | 13 +- .../universal-translator/translator.go | 24 +- .../universal_translator.go | 6 + .../go-playground/validator/v10/baked_in.go | 57 +++- .../validator/v10/country_codes.go | 1 - .../go-playground/validator/v10/doc.go | 2 +- .../go-playground/validator/v10/errors.go | 11 +- .../validator/v10/struct_level.go | 2 + .../go-playground/validator/v10/util.go | 6 + .../go-playground/validator/v10/validator.go | 7 + .../validator/v10/validator_instance.go | 7 + .../github.com/golang/protobuf/proto/proto.go | 1 - .../golang/protobuf/proto/registry.go | 6 +- vendor/github.com/hashicorp/hcl/decoder.go | 12 +- .../hashicorp/hcl/hcl/printer/nodes.go | 4 +- .../jacobweinstock/registrar/registrar.go | 4 +- .../jmespath/go-jmespath/functions.go | 24 -- .../github.com/jmespath/go-jmespath/parser.go | 3 +- vendor/github.com/json-iterator/go/any.go | 6 +- vendor/github.com/json-iterator/go/any_str.go | 1 + vendor/github.com/json-iterator/go/config.go | 10 +- vendor/github.com/json-iterator/go/iter.go | 6 +- .../github.com/json-iterator/go/iter_float.go | 10 +- .../github.com/json-iterator/go/iter_int.go | 14 +- vendor/github.com/json-iterator/go/reflect.go | 1 - .../json-iterator/go/reflect_array.go | 3 +- .../json-iterator/go/reflect_dynamic.go | 6 +- .../json-iterator/go/reflect_extension.go | 20 +- .../json-iterator/go/reflect_json_number.go | 15 +- .../go/reflect_json_raw_message.go | 15 +- .../json-iterator/go/reflect_map.go | 3 +- .../json-iterator/go/reflect_marshaler.go | 10 +- .../json-iterator/go/reflect_native.go | 36 ++- .../json-iterator/go/reflect_optional.go | 11 +- .../json-iterator/go/reflect_slice.go | 3 +- .../go/reflect_struct_decoder.go | 48 +-- .../go/reflect_struct_encoder.go | 6 +- vendor/github.com/leodido/go-urn/machine.go | 12 +- vendor/github.com/leodido/go-urn/urn.go | 2 +- .../magiconair/properties/decode.go | 2 - .../magiconair/properties/properties.go | 1 + .../mitchellh/go-homedir/homedir.go | 6 +- .../mitchellh/mapstructure/mapstructure.go | 1 + vendor/github.com/modern-go/concurrent/log.go | 6 +- .../concurrent/unbounded_executor.go | 2 +- .../github.com/modern-go/reflect2/reflect2.go | 15 +- .../github.com/modern-go/reflect2/type_map.go | 6 +- .../github.com/pelletier/go-toml/marshal.go | 20 +- vendor/github.com/pelletier/go-toml/parser.go | 6 +- vendor/github.com/pelletier/go-toml/toml.go | 6 +- .../github.com/rcrowley/go-metrics/debug.go | 10 +- .../rcrowley/go-metrics/graphite.go | 2 +- vendor/github.com/rcrowley/go-metrics/json.go | 2 +- vendor/github.com/rcrowley/go-metrics/log.go | 2 +- .../rcrowley/go-metrics/opentsdb.go | 2 +- .../rcrowley/go-metrics/registry.go | 2 +- .../github.com/rcrowley/go-metrics/runtime.go | 2 +- .../github.com/rcrowley/go-metrics/syslog.go | 2 +- .../github.com/rcrowley/go-metrics/writer.go | 2 +- .../github.com/sirupsen/logrus/buffer_pool.go | 4 +- vendor/github.com/sirupsen/logrus/exported.go | 6 +- vendor/github.com/sirupsen/logrus/logger.go | 6 +- .../sirupsen/logrus/text_formatter.go | 1 + vendor/github.com/spf13/afero/afero.go | 2 +- vendor/github.com/spf13/afero/ioutil.go | 7 +- vendor/github.com/spf13/afero/mem/file.go | 3 - vendor/github.com/spf13/afero/memmap.go | 4 +- vendor/github.com/spf13/afero/unionFile.go | 3 +- vendor/github.com/spf13/afero/util.go | 1 + vendor/github.com/spf13/cast/caste.go | 16 +- .../spf13/cobra/bash_completions.go | 1 - vendor/github.com/spf13/cobra/cobra.go | 1 + vendor/github.com/spf13/pflag/bool_slice.go | 2 + vendor/github.com/spf13/pflag/bytes.go | 6 + vendor/github.com/spf13/pflag/flag.go | 1 + vendor/github.com/spf13/pflag/golangflag.go | 2 +- vendor/github.com/spf13/pflag/ip_slice.go | 2 + vendor/github.com/spf13/pflag/string.go | 1 - vendor/github.com/spf13/viper/viper.go | 58 ---- vendor/github.com/ugorji/go/codec/binc.go | 22 +- vendor/github.com/ugorji/go/codec/cbor.go | 16 +- vendor/github.com/ugorji/go/codec/decimal.go | 16 +- vendor/github.com/ugorji/go/codec/decode.go | 17 +- vendor/github.com/ugorji/go/codec/doc.go | 2 +- vendor/github.com/ugorji/go/codec/encode.go | 18 +- .../ugorji/go/codec/fast-path.generated.go | 303 +----------------- .../ugorji/go/codec/fast-path.not.go | 22 +- vendor/github.com/ugorji/go/codec/gen.go | 46 ++- vendor/github.com/ugorji/go/codec/helper.go | 25 +- .../ugorji/go/codec/helper_not_unsafe.go | 6 - .../ugorji/go/codec/helper_unsafe.go | 26 +- vendor/github.com/ugorji/go/codec/json.go | 26 +- vendor/github.com/ugorji/go/codec/msgpack.go | 30 +- vendor/github.com/ugorji/go/codec/reader.go | 3 +- vendor/github.com/ugorji/go/codec/rpc.go | 2 +- vendor/github.com/ugorji/go/codec/simple.go | 16 +- .../ugorji/go/codec/sort-slice.generated.go | 8 +- vendor/github.com/ugorji/go/codec/writer.go | 15 - vendor/go.uber.org/zap/stacktrace.go | 12 +- vendor/go.uber.org/zap/zapcore/entry.go | 14 +- vendor/golang.org/x/crypto/ssh/certs.go | 3 +- vendor/golang.org/x/crypto/ssh/channel.go | 12 +- vendor/golang.org/x/crypto/ssh/common.go | 1 + vendor/golang.org/x/crypto/ssh/handshake.go | 1 + .../ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go | 1 - vendor/golang.org/x/crypto/ssh/kex.go | 6 +- vendor/golang.org/x/crypto/ssh/messages.go | 15 +- vendor/golang.org/x/crypto/ssh/ssh_gss.go | 10 +- vendor/golang.org/x/sys/cpu/byteorder.go | 6 +- vendor/golang.org/x/sys/cpu/cpu_arm.go | 1 + vendor/golang.org/x/sys/cpu/cpu_x86.go | 1 + vendor/golang.org/x/sys/cpu/hwcap_linux.go | 6 +- vendor/golang.org/x/sys/unix/aliases.go | 8 +- vendor/golang.org/x/sys/unix/cap_freebsd.go | 10 +- vendor/golang.org/x/sys/unix/epoll_zos.go | 5 +- vendor/golang.org/x/sys/unix/fstatfs_zos.go | 12 +- .../x/sys/unix/readdirent_getdirentries.go | 2 +- .../golang.org/x/sys/unix/syscall_darwin.go | 2 +- .../x/sys/unix/syscall_linux_386.go | 6 +- .../x/sys/unix/syscall_linux_arm.go | 6 +- .../x/sys/unix/syscall_linux_mipsx.go | 6 +- vendor/golang.org/x/sys/unix/syscall_unix.go | 2 +- .../x/sys/unix/syscall_unix_gc_ppc64x.go | 3 - .../x/sys/unix/syscall_zos_s390x.go | 20 +- .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 1 - .../x/sys/unix/zsyscall_aix_ppc64_gc.go | 4 +- .../x/sys/unix/zsyscall_aix_ppc64_gccgo.go | 1 - .../x/sys/unix/zsyscall_illumos_amd64.go | 4 +- .../x/sys/unix/zsyscall_solaris_amd64.go | 4 +- .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 9 +- .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 9 +- .../golang.org/x/sys/unix/ztypes_zos_s390x.go | 8 +- vendor/golang.org/x/sys/windows/aliases.go | 6 +- .../x/sys/windows/security_windows.go | 3 - .../x/sys/windows/syscall_windows.go | 8 +- .../golang.org/x/sys/windows/types_windows.go | 51 ++- .../x/text/unicode/norm/tables10.0.0.go | 6 +- .../x/text/unicode/norm/tables11.0.0.go | 6 +- .../x/text/unicode/norm/tables12.0.0.go | 6 +- .../x/text/unicode/norm/tables13.0.0.go | 6 +- .../x/text/unicode/norm/tables9.0.0.go | 6 +- .../protobuf/encoding/prototext/encode.go | 2 +- .../protobuf/internal/descfmt/stringer.go | 2 - .../protobuf/internal/filedesc/desc.go | 7 - .../protobuf/internal/filedesc/desc_init.go | 4 - .../internal/filedesc/desc_list_gen.go | 27 -- .../protobuf/internal/impl/codec_gen.go | 6 + .../protobuf/internal/impl/convert.go | 27 -- .../protobuf/internal/impl/convert_list.go | 8 - .../protobuf/internal/impl/convert_map.go | 9 - .../protobuf/internal/impl/extension.go | 7 - .../protobuf/internal/impl/legacy_enum.go | 5 - .../protobuf/internal/impl/legacy_export.go | 2 +- .../protobuf/internal/impl/legacy_file.go | 2 - .../protobuf/internal/impl/legacy_message.go | 21 -- .../protobuf/internal/impl/merge_gen.go | 2 + .../protobuf/internal/impl/message.go | 1 - .../protobuf/internal/impl/message_reflect.go | 6 - .../internal/impl/message_reflect_gen.go | 30 -- .../protobuf/internal/impl/pointer_unsafe.go | 4 - .../protobuf/internal/set/ints.go | 6 - .../protobuf/internal/strs/strings.go | 2 - .../reflect/protoreflect/value_pure.go | 4 - .../reflect/protoreflect/value_unsafe.go | 4 - .../go-playground/validator.v9/baked_in.go | 57 +++- .../go-playground/validator.v9/errors.go | 11 +- .../validator.v9/struct_level.go | 2 + .../go-playground/validator.v9/util.go | 6 + .../go-playground/validator.v9/validator.go | 7 + .../validator.v9/validator_instance.go | 7 + vendor/gopkg.in/ini.v1/deprecated.go | 6 +- vendor/gopkg.in/ini.v1/key.go | 3 + vendor/gopkg.in/ini.v1/parser.go | 1 + vendor/gopkg.in/ini.v1/section.go | 1 + vendor/gopkg.in/yaml.v2/apic.go | 2 +- vendor/gopkg.in/yaml.v2/decode.go | 2 +- vendor/gopkg.in/yaml.v2/emitterc.go | 4 + vendor/gopkg.in/yaml.v2/parserc.go | 5 +- vendor/gopkg.in/yaml.v2/readerc.go | 4 +- vendor/gopkg.in/yaml.v2/resolve.go | 10 +- vendor/gopkg.in/yaml.v2/scannerc.go | 14 +- vendor/gopkg.in/yaml.v2/sorter.go | 2 +- vendor/gopkg.in/yaml.v2/yaml.go | 8 +- vendor/gopkg.in/yaml.v2/yamlprivateh.go | 9 +- vendor/modules.txt | 2 +- 266 files changed, 1219 insertions(+), 1454 deletions(-) diff --git a/go.mod b/go.mod index aee8044..6c2e90f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/bmc-toolbox/bmclib v0.4.15 github.com/bmc-toolbox/gin-go-metrics v0.0.2 github.com/daaku/go.zipexe v1.0.1 // indirect - github.com/gin-gonic/gin v1.7.2 + github.com/gin-gonic/gin v1.7.7 github.com/golang/protobuf v1.4.3 // indirect github.com/mitchellh/go-homedir v1.1.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 59ce69c..8fb604a 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NB github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= -github.com/gin-gonic/gin v1.7.2 h1:Tg03T9yM2xa8j6I3Z3oqLaQRSmKvxPd6g/2HJ6zICFA= -github.com/gin-gonic/gin v1.7.2/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= +github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= diff --git a/vendor/github.com/GeertJohan/go.rice/appended.go b/vendor/github.com/GeertJohan/go.rice/appended.go index 39c7d1d..38d78f9 100644 --- a/vendor/github.com/GeertJohan/go.rice/appended.go +++ b/vendor/github.com/GeertJohan/go.rice/appended.go @@ -125,23 +125,18 @@ type appendedDirInfo struct { func (adi *appendedDirInfo) Name() string { return adi.name } - func (adi *appendedDirInfo) Size() int64 { return 0 } - func (adi *appendedDirInfo) Mode() os.FileMode { return os.ModeDir } - func (adi *appendedDirInfo) ModTime() time.Time { return adi.time } - func (adi *appendedDirInfo) IsDir() bool { return true } - func (adi *appendedDirInfo) Sys() interface{} { return nil } diff --git a/vendor/github.com/GeertJohan/go.rice/box.go b/vendor/github.com/GeertJohan/go.rice/box.go index 0094a7e..208b168 100644 --- a/vendor/github.com/GeertJohan/go.rice/box.go +++ b/vendor/github.com/GeertJohan/go.rice/box.go @@ -140,6 +140,7 @@ func (b *Box) resolveAbsolutePathFromCaller() error { } b.absolutePath = path return nil + } func (b *Box) resolveAbsolutePathFromWorkingDirectory() error { diff --git a/vendor/github.com/GeertJohan/go.rice/virtual.go b/vendor/github.com/GeertJohan/go.rice/virtual.go index fc65147..b175849 100644 --- a/vendor/github.com/GeertJohan/go.rice/virtual.go +++ b/vendor/github.com/GeertJohan/go.rice/virtual.go @@ -100,6 +100,7 @@ func (vf *virtualFile) read(bts []byte) (int, error) { n := copy(bts, vf.Content[vf.offset:end]) vf.offset += int64(n) return n, nil + } func (vf *virtualFile) seek(offset int64, whence int) (int64, error) { @@ -180,6 +181,7 @@ func (vd *virtualDir) stat() (os.FileInfo, error) { } func (vd *virtualDir) readdir(n int) ([]os.FileInfo, error) { + if vd.closed { return nil, &os.PathError{ Op: "readdir", @@ -223,9 +225,11 @@ func (vd *virtualDir) readdir(n int) ([]os.FileInfo, error) { offset := vd.offset vd.offset += n return files[offset : offset+n], nil + } func (vd *virtualDir) readdirnames(n int) ([]string, error) { + if vd.closed { return nil, &os.PathError{ Op: "readdir", diff --git a/vendor/github.com/GeertJohan/go.rice/walk.go b/vendor/github.com/GeertJohan/go.rice/walk.go index a4f574c..ee08ed5 100644 --- a/vendor/github.com/GeertJohan/go.rice/walk.go +++ b/vendor/github.com/GeertJohan/go.rice/walk.go @@ -10,6 +10,7 @@ import ( // Walk is like filepath.Walk() // Visit http://golang.org/pkg/path/filepath/#Walk for more information func (b *Box) Walk(path string, walkFn filepath.WalkFunc) error { + pathFile, err := b.Open(path) if err != nil { return err @@ -27,15 +28,19 @@ func (b *Box) Walk(path string, walkFn filepath.WalkFunc) error { // We don't have any embedded or appended box so use live filesystem mode return filepath.Walk(filepath.Join(b.absolutePath, path), func(path string, info os.FileInfo, err error) error { + // Strip out the box name from the returned paths path = strings.TrimPrefix(path, b.absolutePath+string(os.PathSeparator)) return walkFn(path, info, err) + }) + } // walk recursively descends path. // See walk() in $GOROOT/src/pkg/path/filepath/path.go func (b *Box) walk(path string, info os.FileInfo, walkFn filepath.WalkFunc) error { + err := walkFn(path, info, nil) if err != nil { if info.IsDir() && err == filepath.SkipDir { @@ -78,11 +83,13 @@ func (b *Box) walk(path string, info os.FileInfo, walkFn filepath.WalkFunc) erro } return nil + } // readDirNames reads the directory named by path and returns a sorted list of directory entries. // See readDirNames() in $GOROOT/pkg/path/filepath/path.go func (b *Box) readDirNames(path string) ([]string, error) { + f, err := b.Open(path) if err != nil { return nil, err @@ -111,4 +118,5 @@ func (b *Box) readDirNames(path string) ([]string, error) { sort.Strings(names) return names, nil + } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go index 5f053e3..a4eb6a7 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go @@ -217,4 +217,5 @@ func setValue(dstVal reflect.Value, src interface{}) { } else { dstVal.Set(srcVal) } + } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go index 30bac38..9f6af19 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go @@ -76,6 +76,7 @@ func (d *DefaultRetryer) setRetryerDefaults() { // RetryRules returns the delay duration before retrying this request again func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { + // if number of max retries is zero, no retries will be performed. if d.NumMaxRetries == 0 { return 0 @@ -128,6 +129,7 @@ func getJitterDelay(duration time.Duration) time.Duration { // ShouldRetry returns true if the request should be retried. func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { + // ShouldRetry returns false if number of max retries is 0. if d.NumMaxRetries == 0 { return false diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go index 7d19ef2..39fa6d5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -386,6 +386,7 @@ func (c *Config) WithS3Disable100Continue(disable bool) *Config { func (c *Config) WithS3UseAccelerate(enable bool) *Config { c.S3UseAccelerate = &enable return c + } // WithS3DisableContentMD5Validation sets a config @@ -393,6 +394,7 @@ func (c *Config) WithS3UseAccelerate(enable bool) *Config { func (c *Config) WithS3DisableContentMD5Validation(enable bool) *Config { c.S3DisableContentMD5Validation = &enable return c + } // WithS3UseARNRegion sets a config S3UseARNRegion value and diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index 753039c..d95a5eb 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -216,8 +216,7 @@ var AfterRetryHandler = request.NamedHandler{ r.RetryCount++ r.Error = nil } - }, -} + }} // ValidateEndpointHandler is a request handler to validate a request had the // appropriate Region and Endpoint set. Will set r.Error if the endpoint or diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go index 0ef56ac..ab69c7a 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go @@ -16,10 +16,8 @@ var SDKVersionUserAgentHandler = request.NamedHandler{ runtime.Version(), runtime.GOOS, runtime.GOARCH), } -const ( - execEnvVar = `AWS_EXECUTION_ENV` - execEnvUAKey = `exec-env` -) +const execEnvVar = `AWS_EXECUTION_ENV` +const execEnvUAKey = `exec-env` // AddHostExecEnvUserAgentHander is a request handler appending the SDK's // execution environment to the user agent. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go index 38cde1a..3ad1e79 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go @@ -4,15 +4,17 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" ) -// ErrNoValidProvidersFoundInChain Is returned when there are no valid -// providers in the ChainProvider. -// -// This has been deprecated. For verbose error messaging set -// aws.Config.CredentialsChainVerboseErrors to true. -var ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders", - `no valid providers in chain. Deprecated. +var ( + // ErrNoValidProvidersFoundInChain Is returned when there are no valid + // providers in the ChainProvider. + // + // This has been deprecated. For verbose error messaging set + // aws.Config.CredentialsChainVerboseErrors to true. + ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders", + `no valid providers in chain. Deprecated. For verbose messaging see aws.Config.CredentialsChainVerboseErrors`, - nil) + nil) +) // A ChainProvider will search for a provider which returns credentials // and cache that provider until Retrieve is called again. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go index 8634c5d..e624836 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go @@ -296,6 +296,7 @@ func (p *ProcessProvider) IsExpired() bool { // prepareCommand prepares the command to be executed. func (p *ProcessProvider) prepareCommand() error { + var cmdArgs []string if runtime.GOOS == "windows" { cmdArgs = []string{"cmd.exe", "/C"} @@ -329,6 +330,7 @@ func (p *ProcessProvider) prepareCommand() error { // executeCredentialProcess starts the credential process on the OS and // returns the results or an error. func (p *ProcessProvider) executeCredentialProcess() ([]byte, error) { + if err := p.prepareCommand(); err != nil { return nil, err } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go index 1d2dc62..22b5c5d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go @@ -12,8 +12,10 @@ import ( // SharedCredsProviderName provides a name of SharedCreds provider const SharedCredsProviderName = "SharedCredentialsProvider" -// ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found. -var ErrSharedCredentialsHomeNotFound = awserr.New("UserHomeNotFound", "user home directory not found.", nil) +var ( + // ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found. + ErrSharedCredentialsHomeNotFound = awserr.New("UserHomeNotFound", "user home directory not found.", nil) +) // A SharedCredentialsProvider retrieves access key pair (access key ID, // secret access key, and session token if present) credentials from the current diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go index f6398fc..cbba1e3 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go @@ -7,8 +7,10 @@ import ( // StaticProviderName provides a name of Static provider const StaticProviderName = "StaticProvider" -// ErrStaticCredentialsEmpty is emitted when static credentials are empty. -var ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil) +var ( + // ErrStaticCredentialsEmpty is emitted when static credentials are empty. + ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil) +) // A StaticProvider is a set of credentials which are set programmatically, // and will never expire. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go index 75c9eb4..4b19e28 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go @@ -6,7 +6,9 @@ import ( "sync" ) -var lock sync.Mutex +var ( + lock sync.Mutex +) const ( // DefaultPort is used when no port is specified. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go index 2b151f9..82a3e34 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go @@ -9,8 +9,10 @@ const ( pausedEnum ) -// MetricsChannelSize of metrics to hold in the channel -var MetricsChannelSize = 100 +var ( + // MetricsChannelSize of metrics to hold in the channel + MetricsChannelSize = 100 +) type metricChan struct { ch chan metric diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go index c007047..54a9928 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go @@ -13,7 +13,6 @@ type requestException struct { func (e requestException) Exception() string { return e.exception } - func (e requestException) Message() string { return e.message } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go index 38f423b..835bcd4 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go @@ -20,7 +20,9 @@ type Reporter struct { done chan struct{} } -var sender *Reporter +var ( + sender *Reporter +) func connect(url string) error { const network = "udp" diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go index 9bb15cc..69fa63d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go @@ -37,6 +37,7 @@ func (c *EC2Metadata) getToken(ctx aws.Context, duration time.Duration) (tokenOu req.HTTPRequest.Header.Set(ttlHeader, ttl) err := req.Send() + // Errors with bad request status should be returned. if err != nil { err = awserr.NewRequestFailure( diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go index f49334f..4b29f19 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go @@ -35,6 +35,7 @@ func newTokenProvider(c *EC2Metadata, duration time.Duration) *tokenProvider { // fetchTokenHandler fetches token for EC2Metadata service client by default. func (t *tokenProvider) fetchTokenHandler(r *request.Request) { + // short-circuits to insecure data flow if tokenProvider is disabled. if v := atomic.LoadUint32(&t.disabled); v == 1 { return @@ -46,6 +47,7 @@ func (t *tokenProvider) fetchTokenHandler(r *request.Request) { } output, err := t.client.getToken(r.Context(), t.configuredTTL) + if err != nil { // change the disabled flag on token provider to true, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go index 44de1fc..7736137 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go @@ -136,7 +136,6 @@ func serviceList(ss services) []string { } return list } - func endpointList(es endpoints) []string { list := make([]string, 0, len(es)) for k := range es { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go index c6ff9b2..d597c6e 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go @@ -559,6 +559,7 @@ func (r *Request) prepareRetry() error { if err := r.Error; err != nil { return awserr.New(ErrCodeSerialization, "failed to prepare body for retry", err) + } // Closing response body to ensure that no response body is leaked diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go index b592f5b..752ae47 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go @@ -45,6 +45,7 @@ func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { } cfg.Retryer = retryer return cfg + } // noOpRetryer is a internal no op retryer used when a request is created diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go index c85565c..09a44eb 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go @@ -74,15 +74,15 @@ func adaptToResponseTimeoutError(req *Request) { // svc.PutObjectWithContext(ctx, params, request.WithTimeoutReadCloser(30 * time.Second) func WithResponseReadTimeout(duration time.Duration) Option { return func(r *Request) { - timeoutHandler := NamedHandler{ + + var timeoutHandler = NamedHandler{ HandlerResponseTimeout, func(req *Request) { req.HTTPResponse.Body = &timeoutReadCloser{ reader: req.HTTPResponse.Body, duration: duration, } - }, - } + }} // remove the handler so we are not stomping over any new durations. r.Handlers.Send.RemoveByName(HandlerResponseTimeout) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go b/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go index 289e4df..8630683 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go @@ -172,6 +172,7 @@ func (e *errInvalidParam) AddNestedContext(ctx string) { } else { e.nestedContext = fmt.Sprintf("%s.%s", ctx, e.nestedContext) } + } // An ErrParamRequired represents an required parameter error. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go index c7f5b58..4601f88 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go @@ -167,6 +167,7 @@ func (m WaiterMatchMode) String() string { // retryer ShouldRetry returns false. This normally will happen when the max // wait attempts expires. func (w Waiter) WaitWithContext(ctx aws.Context) error { + for attempt := 1; ; attempt++ { req, err := w.NewRequest(w.RequestOptions) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go index 5206dba..3ddd4e5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go @@ -285,7 +285,6 @@ type credProviderError struct { func (c credProviderError) Retrieve() (credentials.Value, error) { return credentials.Value{}, c.Err } - func (c credProviderError) IsExpired() bool { return true } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go index f504670..038ae22 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go @@ -553,7 +553,7 @@ func loadCSMConfig(envCfg envConfig, cfgFiles []string) (csmConfig, error) { func setTLSOptions(opts *Options, cfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig) error { // CA Bundle can be specified in both environment variable shared config file. - caBundleFilename := envCfg.CustomCABundle + var caBundleFilename = envCfg.CustomCABundle if len(caBundleFilename) == 0 { caBundleFilename = sharedCfg.CustomCABundle } @@ -593,6 +593,7 @@ func setTLSOptions(opts *Options, cfg *aws.Config, envCfg envConfig, sharedCfg s } } else if opts.ClientTLSCert == nil && opts.ClientTLSKey == nil { // Do nothing if neither values are available. + } else { return awserr.New(ErrCodeLoadClientTLSCert, fmt.Sprintf("client TLS cert(%t) and key(%t) must both be provided", @@ -843,6 +844,7 @@ func (s *Session) ClientConfig(service string, cfgs ...*aws.Config) client.Confi const ec2MetadataServiceID = "ec2metadata" func (s *Session) resolveEndpoint(service, region string, cfg *aws.Config) (endpoints.ResolvedEndpoint, error) { + if ep := aws.StringValue(cfg.Endpoint); len(ep) != 0 { return endpoints.ResolvedEndpoint{ URL: endpoints.AddScheme(ep, aws.BoolValue(cfg.DisableSSL)), diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go index 62a6fea..d71f7b3 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go @@ -497,7 +497,6 @@ const logSignInfoMsg = `DEBUG: Request Signature: ---[ STRING TO SIGN ]-------------------------------- %s%s -----------------------------------------------------` - const logSignedURLMsg = ` ---[ SIGNED URL ]------------------------------------ %s` @@ -553,6 +552,7 @@ func (ctx *signingCtx) build(disableHeaderHoisting bool) error { // Returning an error if the request is unsigned, or unable to extract the // signature. func GetSignedRequestSignature(r *http.Request) ([]byte, error) { + if auth := r.Header.Get(authorizationHeader); len(auth) != 0 { ps := strings.Split(auth, ", ") for _, p := range ps { @@ -604,7 +604,6 @@ func buildQuery(r rule, header http.Header) (url.Values, http.Header) { return query, unsignedHeaders } - func (ctx *signingCtx) buildCanonicalHeaders(r rule, header http.Header) { var headers []string headers = append(headers, "host") diff --git a/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go index 4731f3b..0210d27 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go @@ -12,6 +12,7 @@ import ( // Copy of Go 1.8's net/url#URL.Hostname functionality. func URLHostname(url *url.URL) string { return stripPort(url.Host) + } // stripPort is copy of Go 1.8 url#URL.Hostname functionality. diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go index 6a16a13..55fa73e 100644 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go @@ -37,7 +37,7 @@ const ( // parseTable is a state machine to dictate the grammar above. var parseTable = map[ASTKind]map[TokenType]int{ - ASTKindStart: { + ASTKindStart: map[TokenType]int{ TokenLit: StatementState, TokenSep: OpenScopeState, TokenWS: SkipTokenState, @@ -45,7 +45,7 @@ var parseTable = map[ASTKind]map[TokenType]int{ TokenComment: CommentState, TokenNone: TerminalState, }, - ASTKindCommentStatement: { + ASTKindCommentStatement: map[TokenType]int{ TokenLit: StatementState, TokenSep: OpenScopeState, TokenWS: SkipTokenState, @@ -53,7 +53,7 @@ var parseTable = map[ASTKind]map[TokenType]int{ TokenComment: CommentState, TokenNone: MarkCompleteState, }, - ASTKindExpr: { + ASTKindExpr: map[TokenType]int{ TokenOp: StatementPrimeState, TokenLit: ValueState, TokenSep: OpenScopeState, @@ -62,13 +62,13 @@ var parseTable = map[ASTKind]map[TokenType]int{ TokenComment: CommentState, TokenNone: MarkCompleteState, }, - ASTKindEqualExpr: { - TokenLit: ValueState, - TokenWS: SkipTokenState, - TokenNL: SkipState, - TokenNone: SkipState, + ASTKindEqualExpr: map[TokenType]int{ + TokenLit: ValueState, + TokenWS: SkipTokenState, + TokenNL: SkipState, + TokenNone: SkipState, }, - ASTKindStatement: { + ASTKindStatement: map[TokenType]int{ TokenLit: SectionState, TokenSep: CloseScopeState, TokenWS: SkipTokenState, @@ -76,7 +76,7 @@ var parseTable = map[ASTKind]map[TokenType]int{ TokenComment: CommentState, TokenNone: MarkCompleteState, }, - ASTKindExprStatement: { + ASTKindExprStatement: map[TokenType]int{ TokenLit: ValueState, TokenSep: OpenScopeState, TokenOp: ValueState, @@ -86,14 +86,14 @@ var parseTable = map[ASTKind]map[TokenType]int{ TokenNone: TerminalState, TokenComma: SkipState, }, - ASTKindSectionStatement: { + ASTKindSectionStatement: map[TokenType]int{ TokenLit: SectionState, TokenOp: SectionState, TokenSep: CloseScopeState, TokenWS: SectionState, TokenNL: SkipTokenState, }, - ASTKindCompletedSectionStatement: { + ASTKindCompletedSectionStatement: map[TokenType]int{ TokenWS: SkipTokenState, TokenNL: SkipTokenState, TokenLit: StatementState, @@ -101,7 +101,7 @@ var parseTable = map[ASTKind]map[TokenType]int{ TokenComment: CommentState, TokenNone: MarkCompleteState, }, - ASTKindSkipStatement: { + ASTKindSkipStatement: map[TokenType]int{ TokenLit: StatementState, TokenSep: OpenScopeState, TokenWS: SkipTokenState, diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go index 7620fdc..f82095b 100644 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go @@ -4,7 +4,9 @@ import ( "fmt" ) -var emptyRunes = []rune{} +var ( + emptyRunes = []rune{} +) func isSep(b []rune) bool { if len(b) == 0 { diff --git a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/s3err/error.go b/vendor/github.com/aws/aws-sdk-go/internal/s3shared/s3err/error.go index 493ebc0..0b9b0df 100644 --- a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/s3err/error.go +++ b/vendor/github.com/aws/aws-sdk-go/internal/s3shared/s3err/error.go @@ -26,7 +26,6 @@ func (r RequestFailure) Error() string { r.StatusCode(), r.RequestID(), r.hostID) return awserr.SprintError(r.Code(), r.Message(), extra, r.OrigErr()) } - func (r RequestFailure) String() string { return r.Error() } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go index 8e94ba2..1510549 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go @@ -12,7 +12,6 @@ type decodedMessage struct { rawMessage Headers decodedHeaders `json:"headers"` } - type jsonMessage struct { Length json.Number `json:"total_length"` HeadersLen json.Number `json:"headers_length"` diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go index 43e24b2..4743393 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go @@ -174,7 +174,6 @@ func decodeUint8(r io.Reader) (uint8, error) { _, err := io.ReadFull(r, b[:]) return uint8(b[0]), err } - func decodeUint16(r io.Reader) (uint16, error) { var b [2]byte bs := b[:] @@ -184,7 +183,6 @@ func decodeUint16(r io.Reader) (uint16, error) { } return binary.BigEndian.Uint16(bs), nil } - func decodeUint32(r io.Reader) (uint32, error) { var b [4]byte bs := b[:] @@ -194,7 +192,6 @@ func decodeUint32(r io.Reader) (uint32, error) { } return binary.BigEndian.Uint32(bs), nil } - func decodeUint64(r io.Reader) (uint64, error) { var b [8]byte bs := b[:] diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go index e64c7ec..f7427da 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go @@ -6,15 +6,13 @@ import ( "hash/crc32" ) -const ( - preludeLen = 8 - preludeCRCLen = 4 - msgCRCLen = 4 - minMsgLen = preludeLen + preludeCRCLen + msgCRCLen - maxPayloadLen = 1024 * 1024 * 16 // 16MB - maxHeadersLen = 1024 * 128 // 128KB - maxMsgLen = minMsgLen + maxHeadersLen + maxPayloadLen -) +const preludeLen = 8 +const preludeCRCLen = 4 +const msgCRCLen = 4 +const minMsgLen = preludeLen + preludeCRCLen + msgCRCLen +const maxPayloadLen = 1024 * 1024 * 16 // 16MB +const maxHeadersLen = 1024 * 128 // 128KB +const maxMsgLen = minMsgLen + maxHeadersLen + maxPayloadLen var crc32IEEETable = crc32.MakeTable(crc32.IEEE) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go index 3af10dc..1f1d27a 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go @@ -1,11 +1,10 @@ package protocol import ( + "github.com/aws/aws-sdk-go/aws/request" "net" "strconv" "strings" - - "github.com/aws/aws-sdk-go/aws/request" ) // ValidateEndpointHostHandler is a request handler that will validate the diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go index 53c5378..864fb67 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go @@ -16,10 +16,8 @@ import ( "github.com/aws/aws-sdk-go/private/protocol" ) -var ( - timeType = reflect.ValueOf(time.Time{}).Type() - byteSliceType = reflect.ValueOf([]byte{}).Type() -) +var timeType = reflect.ValueOf(time.Time{}).Type() +var byteSliceType = reflect.ValueOf([]byte{}).Type() // BuildJSON builds a JSON string for a given object v. func BuildJSON(v interface{}) ([]byte, error) { diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go index 8022e66..8b2c9bb 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go @@ -226,6 +226,7 @@ func (u unmarshaler) unmarshalMap(value reflect.Value, data interface{}, tag ref } func (u unmarshaler) unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error { + switch d := data.(type) { case nil: return nil // nothing to do here diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go index 4a0e874..1301b14 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go @@ -181,6 +181,7 @@ func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag) continue } else if err != nil { return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err) + } keyStr := strings.TrimSpace(key.String()) str = strings.TrimSpace(str) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go index e0a03f3..92f8b4d 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go @@ -181,6 +181,7 @@ func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string, nor if len(out) != 0 { r.Set(reflect.ValueOf(out)) } + } return nil } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go index 2451a18..98f4cae 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go @@ -74,7 +74,7 @@ func ParseTime(formatName, value string) (time.Time, error) { case UnixTimeFormatName: v, err := strconv.ParseFloat(value, 64) _, dec := math.Modf(v) - dec = sdkmath.Round(dec*1e3) / 1e3 // Rounds 0.1229999 to 0.123 + dec = sdkmath.Round(dec*1e3) / 1e3 //Rounds 0.1229999 to 0.123 if err != nil { return time.Time{}, err } diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go index c2f1eec..89a0a29 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -10382,6 +10382,7 @@ func (es *SelectObjectContentEventStream) runOnStreamPartClose(r *request.Reques return } go es.waitStreamPartClose() + } func (es *SelectObjectContentEventStream) waitStreamPartClose() { @@ -32943,7 +32944,6 @@ func (s *SelectObjectContentOutput) SetEventStream(v *SelectObjectContentEventSt s.EventStream = v return s } - func (s *SelectObjectContentOutput) GetEventStream() *SelectObjectContentEventStream { return s.EventStream } diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go index da26bab..6346b92 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go @@ -62,7 +62,7 @@ func parseOutpostAccessPointResource(a awsarn.ARN, resParts []string) (arn.Outpo return arn.OutpostAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: "outpost resource-id not set"} } - outpostAccessPointARN := arn.OutpostAccessPointARN{} + var outpostAccessPointARN = arn.OutpostAccessPointARN{} switch resParts[1] { case "accesspoint": accessPointARN, err := arn.ParseAccessPointResource(a, resParts[2:]) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go index 4dbb735..eb77d98 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go @@ -170,6 +170,7 @@ func resolveRegionalEndpoint(r *request.Request, region string, endpointsID stri } func updateRequestEndpoint(r *request.Request, endpoint string) (err error) { + r.HTTPRequest.URL, err = url.Parse(endpoint + r.Operation.HTTPPath) if err != nil { return awserr.New(request.ErrCodeSerialization, diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go index ae1b31f..81cdec1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go @@ -58,7 +58,9 @@ func updateEndpointForHostStyle(r *request.Request, bucketName string) { moveBucketToHost(r.HTTPRequest.URL, bucketName) } -var accelElem = []byte("s3-accelerate.dualstack.") +var ( + accelElem = []byte("s3-accelerate.dualstack.") +) func updateEndpointForAccelerate(r *request.Request, bucketName string) { if !hostCompatibleBucketName(r.HTTPRequest.URL, bucketName) { @@ -116,10 +118,8 @@ func hostCompatibleBucketName(u *url.URL, bucket string) bool { return dnsCompatibleBucketName(bucket) } -var ( - reDomain = regexp.MustCompile(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`) - reIPAddress = regexp.MustCompile(`^(\d+\.){3}\d+$`) -) +var reDomain = regexp.MustCompile(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`) +var reIPAddress = regexp.MustCompile(`^(\d+\.){3}\d+$`) // dnsCompatibleBucketName returns true if the bucket name is DNS compatible. // Buckets created outside of the classic region MUST be DNS compatible. diff --git a/vendor/github.com/bmc-toolbox/bmclib/providers/dell/idrac9/model.go b/vendor/github.com/bmc-toolbox/bmclib/providers/dell/idrac9/model.go index 0ae1e6f..831e049 100644 --- a/vendor/github.com/bmc-toolbox/bmclib/providers/dell/idrac9/model.go +++ b/vendor/github.com/bmc-toolbox/bmclib/providers/dell/idrac9/model.go @@ -1,9 +1,7 @@ package idrac9 -type ( - UsersInfo map[int]UserInfo - IdracUsers map[string]UsersInfo -) +type UsersInfo map[int]UserInfo +type IdracUsers map[string]UsersInfo // User struct declares user configuration payload. type UserInfo struct { diff --git a/vendor/github.com/bmc-toolbox/bmclib/providers/hp/c7000/configure.go b/vendor/github.com/bmc-toolbox/bmclib/providers/hp/c7000/configure.go index 538fbfb..89cb322 100644 --- a/vendor/github.com/bmc-toolbox/bmclib/providers/hp/c7000/configure.go +++ b/vendor/github.com/bmc-toolbox/bmclib/providers/hp/c7000/configure.go @@ -543,11 +543,11 @@ func (c *C7000) User(users []*cfgresources.User) (err error) { payload := AddUser{Username: username, Password: password} statusCode, _, err := c.postXML(payload) - if err != nil || statusCode != 200 && statusCode != 400 { + if err != nil || statusCode != 200 { if err == nil { - allErrors += fmt.Sprintf("Received a %d status code from the POST request to add user %s.", statusCode, cfg.Name) + allErrors += fmt.Sprintf("Received a %d status code from the POST request to add user %s.", statusCode, username) } else { - allErrors += fmt.Sprintf("POST request to add user %s failed with error: %s", cfg.Name, err.Error()) + allErrors += fmt.Sprintf("POST request to add user %s failed with error: %s", username, err.Error()) } continue } diff --git a/vendor/github.com/bmc-toolbox/bmclib/providers/hp/c7000/setupConnections.go b/vendor/github.com/bmc-toolbox/bmclib/providers/hp/c7000/setupConnections.go index 52768fb..94ce9cc 100644 --- a/vendor/github.com/bmc-toolbox/bmclib/providers/hp/c7000/setupConnections.go +++ b/vendor/github.com/bmc-toolbox/bmclib/providers/hp/c7000/setupConnections.go @@ -48,7 +48,7 @@ func (c *C7000) httpLogin() (err error) { return err } - // req.Header.Add("Content-Type", "application/soap+xml; charset=utf-8") + //req.Header.Add("Content-Type", "application/soap+xml; charset=utf-8") req.Header.Add("Content-Type", "text/plain;charset=UTF-8") reqDump, _ := httputil.DumpRequestOut(req, true) diff --git a/vendor/github.com/bmc-toolbox/gin-go-metrics/helpers.go b/vendor/github.com/bmc-toolbox/gin-go-metrics/helpers.go index 19d451a..74564d9 100644 --- a/vendor/github.com/bmc-toolbox/gin-go-metrics/helpers.go +++ b/vendor/github.com/bmc-toolbox/gin-go-metrics/helpers.go @@ -56,6 +56,7 @@ func Scheduler(interval time.Duration, fn interface{}, args ...interface{}) { // GoRuntimeStats collects go runtime stats. // prefix is a slice of metric namespace nodes. func GoRuntimeStats(prefix []string) { + prefix = append(prefix, "runtime") UpdateGauge(append(prefix, "num_goroutines"), int64(runtime.NumGoroutine())) @@ -110,7 +111,7 @@ func GoRuntimeStats(prefix []string) { // MeasureRuntime measures time elapsed since invocation func MeasureRuntime(key []string, start time.Time) { - // convert time.Duration to milliseconds + //convert time.Duration to milliseconds elapsed := int64(time.Since(start) / time.Millisecond) UpdateGauge(key, elapsed) } diff --git a/vendor/github.com/bmc-toolbox/gin-go-metrics/metrics.go b/vendor/github.com/bmc-toolbox/gin-go-metrics/metrics.go index f9a1044..9d023e1 100644 --- a/vendor/github.com/bmc-toolbox/gin-go-metrics/metrics.go +++ b/vendor/github.com/bmc-toolbox/gin-go-metrics/metrics.go @@ -42,9 +42,9 @@ type emitter struct { // metric struct holds attributes for a metric. type metric struct { - Type string // counter/gauge - Key []string // metric key - Value float64 // metric value + Type string //counter/gauge + Key []string //metric key + Value float64 //metric value } // Setup sets up external and internal metric sinks. @@ -60,7 +60,7 @@ func Setup(clientType string, host string, port int, prefix string, flushInterva graphiteConfig = graphite.Config{} - // setup metrics client based on config + //setup metrics client based on config switch clientType { case "graphite": addr, err := net.ResolveTCPAddr("tcp", fmt.Sprintf("%s:%d", host, port)) @@ -81,7 +81,7 @@ func Setup(clientType string, host string, port int, prefix string, flushInterva return fmt.Errorf("no supported metrics client declared in config") } - // go routine that stores data + //go routine that stores data go emm.store() return err @@ -90,7 +90,7 @@ func Setup(clientType string, host string, port int, prefix string, flushInterva //- writes/updates metric key/vals to registry //- register and write metrics to the go-metrics registries. func (e *emitter) store() { - // A map of metric names to go-metrics registry + //A map of metric names to go-metrics registry goMetricsRegistry := make(map[string]interface{}) for { @@ -101,8 +101,8 @@ func (e *emitter) store() { key := strings.Join(data.Key, ".") - // register the metric with go-metrics, - // the metric key is used as the identifier. + //register the metric with go-metrics, + //the metric key is used as the identifier. _, registryExists := goMetricsRegistry[key] if !registryExists { switch data.Type { @@ -121,26 +121,26 @@ func (e *emitter) store() { } } - // based on the metric type, update the store/registry. + //based on the metric type, update the store/registry. switch data.Type { case "counter": - // type assert metrics registry to its type - metrics.Counter - // type cast float64 metric value type to int64 + //type assert metrics registry to its type - metrics.Counter + //type cast float64 metric value type to int64 goMetricsRegistry[key].(metrics.Counter).Inc( int64(data.Value)) case "gauge": - // type assert metrics registry to its type - metrics.Gauge - // type cast float64 metric value type to int64 + //type assert metrics registry to its type - metrics.Gauge + //type cast float64 metric value type to int64 goMetricsRegistry[key].(metrics.Gauge).Update( int64(data.Value)) case "timer": - // type assert metrics registry to its type - metrics.Timer - // type cast float64 metric value type to time.Duration + //type assert metrics registry to its type - metrics.Timer + //type cast float64 metric value type to time.Duration goMetricsRegistry[key].(metrics.Timer).Update( time.Duration(data.Value)) case "histogram": - // type assert metrics registry to its type - metrics.Histogram - // type cast float64 metric value type to int64 + //type assert metrics registry to its type - metrics.Histogram + //type cast float64 metric value type to int64 goMetricsRegistry[key].(metrics.Histogram).Update( int64(data.Value)) } @@ -148,9 +148,10 @@ func (e *emitter) store() { } // IncrCounter sets up metric attributes and passes them to the metricsChan. -// key = slice of strings that will be joined with "." to be used as the metric namespace -// val = float64 metric value +//key = slice of strings that will be joined with "." to be used as the metric namespace +//val = float64 metric value func IncrCounter(key []string, value int64) { + // incase this method was invoked without the emmiter being initialized. if emm == nil { return @@ -166,9 +167,10 @@ func IncrCounter(key []string, value int64) { } // UpdateGauge sets up the Gauge metric and passes them to the metricsChan. -// key = slice of strings that will be joined with "." to be used as the metric namespace -// val = float64 metric value +//key = slice of strings that will be joined with "." to be used as the metric namespace +//val = float64 metric value func UpdateGauge(key []string, value int64) { + // incase this method was invoked without the emmiter being initialized. if emm == nil { return @@ -184,9 +186,10 @@ func UpdateGauge(key []string, value int64) { } // UpdateTimer sets up the Timer metric and passes them to the metricsChan. -// key = slice of strings that will be joined with "." to be used as the metric namespace -// val = time.Time metric value +//key = slice of strings that will be joined with "." to be used as the metric namespace +//val = time.Time metric value func UpdateTimer(key []string, value time.Duration) { + // incase this method was invoked without the emmiter being initialized. if emm == nil { return @@ -202,9 +205,10 @@ func UpdateTimer(key []string, value time.Duration) { } // UpdateHistogram sets up the Histogram metric and passes them to the metricsChan. -// key = slice of strings that will be joined with "." to be used as the metric namespace -// val = int64 metric value +//key = slice of strings that will be joined with "." to be used as the metric namespace +//val = int64 metric value func UpdateHistogram(key []string, value int64) { + // incase this method was invoked without the emmiter being initialized. if emm == nil { return @@ -221,6 +225,7 @@ func UpdateHistogram(key []string, value int64) { // Close runs cleanup actions func Close(printStats bool) { + // incase this method was invoked without the emmiter being initialized. if emm == nil { return diff --git a/vendor/github.com/bmc-toolbox/gin-go-metrics/middleware/middleware.go b/vendor/github.com/bmc-toolbox/gin-go-metrics/middleware/middleware.go index 7ad8712..2a1c9de 100644 --- a/vendor/github.com/bmc-toolbox/gin-go-metrics/middleware/middleware.go +++ b/vendor/github.com/bmc-toolbox/gin-go-metrics/middleware/middleware.go @@ -84,7 +84,7 @@ func contains(slice []string, s string) bool { return false } -// HandlerFunc is a function which should be used as middleware to count requests stats +//HandlerFunc is a function which should be used as middleware to count requests stats // such as request processing time, request and responce size and store it in rcrowley/go-metrics.DefaultRegistry. func (m *Metrics) HandlerFunc(metricsPrefix []string, ignoreURLs []string, replaceSlashWithUnderscore bool) gin.HandlerFunc { theRegistry := newRegistry() @@ -123,7 +123,7 @@ func (m *Metrics) HandlerFunc(metricsPrefix []string, ignoreURLs []string, repla ) theRegistry.timer(processTimeKey).Update(elapsed) theRegistry.histogram(reqSzKey).Update(reqSz) - theRegistry.histogram(resSzKey).Update(resSz) + theRegistry.histogram(resSzKey, ).Update(resSz) } } diff --git a/vendor/github.com/bombsimon/logrusr/logrusr.go b/vendor/github.com/bombsimon/logrusr/logrusr.go index 7fc2932..e4d7ce9 100644 --- a/vendor/github.com/bombsimon/logrusr/logrusr.go +++ b/vendor/github.com/bombsimon/logrusr/logrusr.go @@ -120,7 +120,7 @@ func (l *logrusr) Error(err error, msg string, keysAndValues ...interface{}) { // listToLogrusFields converts a list of arbitrary length to key/value paris. func listToLogrusFields(formatter func(interface{}) string, keysAndValues ...interface{}) logrus.Fields { - f := logrus.Fields{} + var f = logrus.Fields{} // Skip all fields if it's not an even lengthed list. if len(keysAndValues)%2 != 0 { diff --git a/vendor/github.com/cyberdelia/go-metrics-graphite/graphite.go b/vendor/github.com/cyberdelia/go-metrics-graphite/graphite.go index 67d68e5..4489f0b 100644 --- a/vendor/github.com/cyberdelia/go-metrics-graphite/graphite.go +++ b/vendor/github.com/cyberdelia/go-metrics-graphite/graphite.go @@ -40,7 +40,7 @@ func Graphite(r metrics.Registry, d time.Duration, prefix string, addr *net.TCPA // WithConfig is a blocking exporter function just like Graphite, // but it takes a GraphiteConfig instead. func WithConfig(c Config) { - for range time.Tick(c.FlushInterval) { + for _ = range time.Tick(c.FlushInterval) { if err := graphite(&c); nil != err { log.Println(err) } diff --git a/vendor/github.com/fsnotify/fsnotify/kqueue.go b/vendor/github.com/fsnotify/fsnotify/kqueue.go index 860ed46..86e76a3 100644 --- a/vendor/github.com/fsnotify/fsnotify/kqueue.go +++ b/vendor/github.com/fsnotify/fsnotify/kqueue.go @@ -73,7 +73,7 @@ func (w *Watcher) Close() error { w.isClosed = true // copy paths to remove while locked - pathsToRemove := make([]string, 0, len(w.watches)) + var pathsToRemove = make([]string, 0, len(w.watches)) for name := range w.watches { pathsToRemove = append(pathsToRemove, name) } @@ -428,6 +428,7 @@ func (w *Watcher) sendDirectoryChangeEvents(dirPath string) { for _, fileInfo := range files { filePath := filepath.Join(dirPath, fileInfo.Name()) err := w.sendFileCreatedEventIfNew(filePath, fileInfo) + if err != nil { return } diff --git a/vendor/github.com/fsnotify/fsnotify/windows.go b/vendor/github.com/fsnotify/fsnotify/windows.go index 2ac224b..09436f3 100644 --- a/vendor/github.com/fsnotify/fsnotify/windows.go +++ b/vendor/github.com/fsnotify/fsnotify/windows.go @@ -171,10 +171,8 @@ type watch struct { buf [4096]byte } -type ( - indexMap map[uint64]*watch - watchMap map[uint32]indexMap -) +type indexMap map[uint64]*watch +type watchMap map[uint32]indexMap func (w *Watcher) wakeupReader() error { e := syscall.PostQueuedCompletionStatus(w.port, 0, 0, nil) diff --git a/vendor/github.com/gin-contrib/sse/sse-decoder.go b/vendor/github.com/gin-contrib/sse/sse-decoder.go index 879373a..fd49b9c 100644 --- a/vendor/github.com/gin-contrib/sse/sse-decoder.go +++ b/vendor/github.com/gin-contrib/sse/sse-decoder.go @@ -22,7 +22,7 @@ func Decode(r io.Reader) ([]Event, error) { func (d *decoder) dispatchEvent(event Event, data string) { dataLength := len(data) if dataLength > 0 { - // If the data buffer's last character is a U+000A LINE FEED (LF) character, then remove the last character from the data buffer. + //If the data buffer's last character is a U+000A LINE FEED (LF) character, then remove the last character from the data buffer. data = data[:dataLength-1] dataLength-- } @@ -105,7 +105,7 @@ func (d *decoder) decode(r io.Reader) ([]Event, error) { // then append a single U+000A LINE FEED (LF) character to the data buffer. dataBuffer.WriteString("\n") default: - // Otherwise. The field is ignored. + //Otherwise. The field is ignored. continue } } diff --git a/vendor/github.com/gin-contrib/sse/sse-encoder.go b/vendor/github.com/gin-contrib/sse/sse-encoder.go index 42b4043..f9c8087 100644 --- a/vendor/github.com/gin-contrib/sse/sse-encoder.go +++ b/vendor/github.com/gin-contrib/sse/sse-encoder.go @@ -20,10 +20,8 @@ import ( const ContentType = "text/event-stream" -var ( - contentType = []string{ContentType} - noCache = []string{"no-cache"} -) +var contentType = []string{ContentType} +var noCache = []string{"no-cache"} var fieldReplacer = strings.NewReplacer( "\n", "\\n", diff --git a/vendor/github.com/gin-gonic/gin/.travis.yml b/vendor/github.com/gin-gonic/gin/.travis.yml index 8ebae71..bcc2141 100644 --- a/vendor/github.com/gin-gonic/gin/.travis.yml +++ b/vendor/github.com/gin-gonic/gin/.travis.yml @@ -3,8 +3,6 @@ language: go matrix: fast_finish: true include: - - go: 1.12.x - env: GO111MODULE=on - go: 1.13.x - go: 1.13.x env: diff --git a/vendor/github.com/gin-gonic/gin/CHANGELOG.md b/vendor/github.com/gin-gonic/gin/CHANGELOG.md index a28edc8..4c806a5 100644 --- a/vendor/github.com/gin-gonic/gin/CHANGELOG.md +++ b/vendor/github.com/gin-gonic/gin/CHANGELOG.md @@ -1,5 +1,41 @@ # Gin ChangeLog +## Gin v1.7.7 + +### BUGFIXES + +* Fixed X-Forwarded-For unsafe handling of CVE-2020-28483 [#2844](https://github.com/gin-gonic/gin/pull/2844), closed issue [#2862](https://github.com/gin-gonic/gin/issues/2862). +* Tree: updated the code logic for `latestNode` [#2897](https://github.com/gin-gonic/gin/pull/2897), closed issue [#2894](https://github.com/gin-gonic/gin/issues/2894) [#2878](https://github.com/gin-gonic/gin/issues/2878). +* Tree: fixed the misplacement of adding slashes [#2847](https://github.com/gin-gonic/gin/pull/2847), closed issue [#2843](https://github.com/gin-gonic/gin/issues/2843). +* Tree: fixed tsr with mixed static and wildcard paths [#2924](https://github.com/gin-gonic/gin/pull/2924), closed issue [#2918](https://github.com/gin-gonic/gin/issues/2918). + +### ENHANCEMENTS + +* TrustedProxies: make it backward-compatible [#2887](https://github.com/gin-gonic/gin/pull/2887), closed issue [#2819](https://github.com/gin-gonic/gin/issues/2819). +* TrustedPlatform: provide custom options for another CDN services [#2906](https://github.com/gin-gonic/gin/pull/2906). + +### DOCS + +* NoMethod: added usage annotation ([#2832](https://github.com/gin-gonic/gin/pull/2832#issuecomment-929954463)). + +## Gin v1.7.6 + +### BUGFIXES + +* bump new release to fix v1.7.5 release error by using v1.7.4 codes. + +## Gin v1.7.4 + +### BUGFIXES + +* bump new release to fix checksum mismatch + +## Gin v1.7.3 + +### BUGFIXES + +* fix level 1 router match [#2767](https://github.com/gin-gonic/gin/issues/2767), [#2796](https://github.com/gin-gonic/gin/issues/2796) + ## Gin v1.7.2 ### BUGFIXES diff --git a/vendor/github.com/gin-gonic/gin/README.md b/vendor/github.com/gin-gonic/gin/README.md index d4772d7..9bf459b 100644 --- a/vendor/github.com/gin-gonic/gin/README.md +++ b/vendor/github.com/gin-gonic/gin/README.md @@ -77,6 +77,7 @@ Gin is a web framework written in Go (Golang). It features a martini-like API wi - [http2 server push](#http2-server-push) - [Define format for the log of routes](#define-format-for-the-log-of-routes) - [Set and get a cookie](#set-and-get-a-cookie) + - [Don't trust all proxies](#don't-trust-all-proxies) - [Testing](#testing) - [Users](#users) @@ -84,7 +85,7 @@ Gin is a web framework written in Go (Golang). It features a martini-like API wi To install Gin package, you need to install Go and set your Go workspace first. -1. The first need [Go](https://golang.org/) installed (**version 1.12+ is required**), then you can use the below Go command to install Gin. +1. The first need [Go](https://golang.org/) installed (**version 1.13+ is required**), then you can use the below Go command to install Gin. ```sh $ go get -u github.com/gin-gonic/gin @@ -2130,11 +2131,17 @@ Gin lets you specify which headers to hold the real client IP (if any), as well as specifying which proxies (or direct clients) you trust to specify one of these headers. -The `TrustedProxies` slice on your `gin.Engine` specifes network addresses or -network CIDRs from where clients which their request headers related to client +Use function `SetTrustedProxies()` on your `gin.Engine` to specify network addresses +or network CIDRs from where clients which their request headers related to client IP can be trusted. They can be IPv4 addresses, IPv4 CIDRs, IPv6 addresses or IPv6 CIDRs. +**Attention:** Gin trust all proxies by default if you don't specify a trusted +proxy using the function above, **this is NOT safe**. At the same time, if you don't +use any proxy, you can disable this feature by using `Engine.SetTrustedProxies(nil)`, +then `Context.ClientIP()` will return the remote address directly to avoid some +unnecessary computation. + ```go import ( "fmt" @@ -2145,7 +2152,7 @@ import ( func main() { router := gin.Default() - router.TrustedProxies = []string{"192.168.1.2"} + router.SetTrustedProxies([]string{"192.168.1.2"}) router.GET("/", func(c *gin.Context) { // If the client is 192.168.1.2, use the X-Forwarded-For @@ -2158,6 +2165,34 @@ func main() { } ``` +**Notice:** If you are using a CDN service, you can set the `Engine.TrustedPlatform` +to skip TrustedProxies check, it has a higher priority than TrustedProxies. +Look at the example below: +```go +import ( + "fmt" + + "github.com/gin-gonic/gin" +) + +func main() { + + router := gin.Default() + // Use predefined header gin.PlatformXXX + router.TrustedPlatform = gin.PlatformGoogleAppEngine + // Or set your own trusted request header for another trusted proxy service + // Don't set it to any suspect request header, it's unsafe + router.TrustedPlatform = "X-CDN-IP" + + router.GET("/", func(c *gin.Context) { + // If you set TrustedPlatform, ClientIP() will resolve the + // corresponding header and return IP directly + fmt.Printf("ClientIP: %s\n", c.ClientIP()) + }) + router.Run() +} +``` + ## Testing The `net/http/httptest` package is preferable way for HTTP testing. diff --git a/vendor/github.com/gin-gonic/gin/binding/form.go b/vendor/github.com/gin-gonic/gin/binding/form.go index 8b45c50..b93c34c 100644 --- a/vendor/github.com/gin-gonic/gin/binding/form.go +++ b/vendor/github.com/gin-gonic/gin/binding/form.go @@ -10,11 +10,9 @@ import ( const defaultMemory = 32 << 20 -type ( - formBinding struct{} - formPostBinding struct{} - formMultipartBinding struct{} -) +type formBinding struct{} +type formPostBinding struct{} +type formMultipartBinding struct{} func (formBinding) Name() string { return "form" diff --git a/vendor/github.com/gin-gonic/gin/binding/form_mapping.go b/vendor/github.com/gin-gonic/gin/binding/form_mapping.go index a6a818e..2f4e45b 100644 --- a/vendor/github.com/gin-gonic/gin/binding/form_mapping.go +++ b/vendor/github.com/gin-gonic/gin/binding/form_mapping.go @@ -71,7 +71,7 @@ func mapping(value reflect.Value, field reflect.StructField, setter setter, tag return false, nil } - vKind := value.Kind() + var vKind = value.Kind() if vKind == reflect.Ptr { var isNew bool @@ -298,6 +298,7 @@ func setTimeField(val string, structField reflect.StructField, value reflect.Val t := time.Unix(tv/int64(d), tv%int64(d)) value.Set(reflect.ValueOf(t)) return nil + } if val == "" { diff --git a/vendor/github.com/gin-gonic/gin/binding/header.go b/vendor/github.com/gin-gonic/gin/binding/header.go index d7211cd..179ce4e 100644 --- a/vendor/github.com/gin-gonic/gin/binding/header.go +++ b/vendor/github.com/gin-gonic/gin/binding/header.go @@ -13,6 +13,7 @@ func (headerBinding) Name() string { } func (headerBinding) Bind(req *http.Request, obj interface{}) error { + if err := mapHeader(obj, req.Header); err != nil { return err } diff --git a/vendor/github.com/gin-gonic/gin/binding/xml.go b/vendor/github.com/gin-gonic/gin/binding/xml.go index b04b18d..4e90114 100644 --- a/vendor/github.com/gin-gonic/gin/binding/xml.go +++ b/vendor/github.com/gin-gonic/gin/binding/xml.go @@ -24,7 +24,6 @@ func (xmlBinding) Bind(req *http.Request, obj interface{}) error { func (xmlBinding) BindBody(body []byte, obj interface{}) error { return decodeXML(bytes.NewReader(body), obj) } - func decodeXML(r io.Reader, obj interface{}) error { decoder := xml.NewDecoder(r) if err := decoder.Decode(obj); err != nil { diff --git a/vendor/github.com/gin-gonic/gin/context.go b/vendor/github.com/gin-gonic/gin/context.go index dc03c35..220d1bc 100644 --- a/vendor/github.com/gin-gonic/gin/context.go +++ b/vendor/github.com/gin-gonic/gin/context.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "io/ioutil" + "log" "math" "mime/multipart" "net" @@ -53,8 +54,9 @@ type Context struct { index int8 fullPath string - engine *Engine - params *Params + engine *Engine + params *Params + skippedNodes *[]skippedNode // This mutex protect Keys map mu sync.RWMutex @@ -96,7 +98,8 @@ func (c *Context) reset() { c.Accepted = nil c.queryCache = nil c.formCache = nil - *c.params = (*c.params)[0:0] + *c.params = (*c.params)[:0] + *c.skippedNodes = (*c.skippedNodes)[:0] } // Copy returns a copy of the current context that can be safely used outside the request's scope. @@ -725,13 +728,23 @@ func (c *Context) ShouldBindBodyWith(obj interface{}, bb binding.BindingBody) (e return bb.BindBody(body, obj) } -// ClientIP implements a best effort algorithm to return the real client IP. +// ClientIP implements one best effort algorithm to return the real client IP. // It called c.RemoteIP() under the hood, to check if the remote IP is a trusted proxy or not. -// If it's it will then try to parse the headers defined in Engine.RemoteIPHeaders (defaulting to [X-Forwarded-For, X-Real-Ip]). -// If the headers are nots syntactically valid OR the remote IP does not correspong to a trusted proxy, +// If it is it will then try to parse the headers defined in Engine.RemoteIPHeaders (defaulting to [X-Forwarded-For, X-Real-Ip]). +// If the headers are not syntactically valid OR the remote IP does not correspond to a trusted proxy, // the remote IP (coming form Request.RemoteAddr) is returned. func (c *Context) ClientIP() string { + // Check if we're running on a trusted platform, continue running backwards if error + if c.engine.TrustedPlatform != "" { + // Developers can define their own header of Trusted Platform or use predefined constants + if addr := c.requestHeader(c.engine.TrustedPlatform); addr != "" { + return addr + } + } + + // Legacy "AppEngine" flag if c.engine.AppEngine { + log.Println(`The AppEngine flag is going to be deprecated. Please check issues #2723 and #2739 and use 'TrustedPlatform: gin.PlatformGoogleAppEngine' instead.`) if addr := c.requestHeader("X-Appengine-Remote-Addr"); addr != "" { return addr } @@ -744,7 +757,7 @@ func (c *Context) ClientIP() string { if trusted && c.engine.ForwardedByClientIP && c.engine.RemoteIPHeaders != nil { for _, headerName := range c.engine.RemoteIPHeaders { - ip, valid := validateHeader(c.requestHeader(headerName)) + ip, valid := c.engine.validateHeader(c.requestHeader(headerName)) if valid { return ip } @@ -753,10 +766,21 @@ func (c *Context) ClientIP() string { return remoteIP.String() } +func (e *Engine) isTrustedProxy(ip net.IP) bool { + if e.trustedCIDRs != nil { + for _, cidr := range e.trustedCIDRs { + if cidr.Contains(ip) { + return true + } + } + } + return false +} + // RemoteIP parses the IP from Request.RemoteAddr, normalizes and returns the IP (without the port). // It also checks if the remoteIP is a trusted proxy or not. // In order to perform this validation, it will see if the IP is contained within at least one of the CIDR blocks -// defined in Engine.TrustedProxies +// defined by Engine.SetTrustedProxies() func (c *Context) RemoteIP() (net.IP, bool) { ip, _, err := net.SplitHostPort(strings.TrimSpace(c.Request.RemoteAddr)) if err != nil { @@ -767,35 +791,25 @@ func (c *Context) RemoteIP() (net.IP, bool) { return nil, false } - if c.engine.trustedCIDRs != nil { - for _, cidr := range c.engine.trustedCIDRs { - if cidr.Contains(remoteIP) { - return remoteIP, true - } - } - } - - return remoteIP, false + return remoteIP, c.engine.isTrustedProxy(remoteIP) } -func validateHeader(header string) (clientIP string, valid bool) { +func (e *Engine) validateHeader(header string) (clientIP string, valid bool) { if header == "" { return "", false } items := strings.Split(header, ",") - for i, ipStr := range items { - ipStr = strings.TrimSpace(ipStr) + for i := len(items) - 1; i >= 0; i-- { + ipStr := strings.TrimSpace(items[i]) ip := net.ParseIP(ipStr) if ip == nil { return "", false } - // We need to return the first IP in the list, but, - // we should not early return since we need to validate that - // the rest of the header is syntactically valid - if i == 0 { - clientIP = ipStr - valid = true + // X-Forwarded-For is appended by proxy + // Check IPs in reverse order and stop when find untrusted proxy + if (i == 0) || (!e.isTrustedProxy(ip)) { + return ipStr, true } } return diff --git a/vendor/github.com/gin-gonic/gin/context_appengine.go b/vendor/github.com/gin-gonic/gin/context_appengine.go index d565843..8bf9389 100644 --- a/vendor/github.com/gin-gonic/gin/context_appengine.go +++ b/vendor/github.com/gin-gonic/gin/context_appengine.go @@ -8,5 +8,5 @@ package gin func init() { - defaultAppEngine = true + defaultPlatform = PlatformGoogleAppEngine } diff --git a/vendor/github.com/gin-gonic/gin/debug.go b/vendor/github.com/gin-gonic/gin/debug.go index 4c7cd0c..9bacc68 100644 --- a/vendor/github.com/gin-gonic/gin/debug.go +++ b/vendor/github.com/gin-gonic/gin/debug.go @@ -12,7 +12,7 @@ import ( "strings" ) -const ginSupportMinGoVer = 12 +const ginSupportMinGoVer = 13 // IsDebugging returns true if the framework is running in debug mode. // Use SetMode(gin.ReleaseMode) to disable debug mode. @@ -67,7 +67,7 @@ func getMinVer(v string) (uint64, error) { func debugPrintWARNINGDefault() { if v, e := getMinVer(runtime.Version()); e == nil && v <= ginSupportMinGoVer { - debugPrint(`[WARNING] Now Gin requires Go 1.12+. + debugPrint(`[WARNING] Now Gin requires Go 1.13+. `) } diff --git a/vendor/github.com/gin-gonic/gin/gin.go b/vendor/github.com/gin-gonic/gin/gin.go index 03a0e12..58e76f4 100644 --- a/vendor/github.com/gin-gonic/gin/gin.go +++ b/vendor/github.com/gin-gonic/gin/gin.go @@ -11,6 +11,7 @@ import ( "net/http" "os" "path" + "reflect" "strings" "sync" @@ -25,7 +26,9 @@ var ( default405Body = []byte("405 method not allowed") ) -var defaultAppEngine bool +var defaultPlatform string + +var defaultTrustedCIDRs = []*net.IPNet{{IP: net.IP{0x0, 0x0, 0x0, 0x0}, Mask: net.IPMask{0x0, 0x0, 0x0, 0x0}}} // 0.0.0.0/0 // HandlerFunc defines the handler used by gin middleware as return value. type HandlerFunc func(*Context) @@ -52,6 +55,16 @@ type RouteInfo struct { // RoutesInfo defines a RouteInfo array. type RoutesInfo []RouteInfo +// Trusted platforms +const ( + // When running on Google App Engine. Trust X-Appengine-Remote-Addr + // for determining the client's IP + PlatformGoogleAppEngine = "X-Appengine-Remote-Addr" + // When using Cloudflare's CDN. Trust CF-Connecting-IP for determining + // the client's IP + PlatformCloudflare = "CF-Connecting-IP" +) + // Engine is the framework's instance, it contains the muxer, middleware and configuration settings. // Create an instance of Engine, by using New() or Default() type Engine struct { @@ -89,18 +102,7 @@ type Engine struct { // `(*gin.Context).Request.RemoteAddr`. ForwardedByClientIP bool - // List of headers used to obtain the client IP when - // `(*gin.Engine).ForwardedByClientIP` is `true` and - // `(*gin.Context).Request.RemoteAddr` is matched by at least one of the - // network origins of `(*gin.Engine).TrustedProxies`. - RemoteIPHeaders []string - - // List of network origins (IPv4 addresses, IPv4 CIDRs, IPv6 addresses or - // IPv6 CIDRs) from which to trust request's headers that contain - // alternative client IP when `(*gin.Engine).ForwardedByClientIP` is - // `true`. - TrustedProxies []string - + // DEPRECATED: USE `TrustedPlatform` WITH VALUE `gin.GoogleAppEngine` INSTEAD // #726 #755 If enabled, it will trust some headers starting with // 'X-AppEngine...' for better integration with that PaaS. AppEngine bool @@ -113,14 +115,24 @@ type Engine struct { // as url.Path gonna be used, which is already unescaped. UnescapePathValues bool - // Value of 'maxMemory' param that is given to http.Request's ParseMultipartForm - // method call. - MaxMultipartMemory int64 - // RemoveExtraSlash a parameter can be parsed from the URL even with extra slashes. // See the PR #1817 and issue #1644 RemoveExtraSlash bool + // List of headers used to obtain the client IP when + // `(*gin.Engine).ForwardedByClientIP` is `true` and + // `(*gin.Context).Request.RemoteAddr` is matched by at least one of the + // network origins of list defined by `(*gin.Engine).SetTrustedProxies()`. + RemoteIPHeaders []string + + // If set to a constant of value gin.Platform*, trusts the headers set by + // that platform, for example to determine the client IP + TrustedPlatform string + + // Value of 'maxMemory' param that is given to http.Request's ParseMultipartForm + // method call. + MaxMultipartMemory int64 + delims render.Delims secureJSONPrefix string HTMLRender render.HTMLRender @@ -132,6 +144,8 @@ type Engine struct { pool sync.Pool trees methodTrees maxParams uint16 + maxSections uint16 + trustedProxies []string trustedCIDRs []*net.IPNet } @@ -159,8 +173,7 @@ func New() *Engine { HandleMethodNotAllowed: false, ForwardedByClientIP: true, RemoteIPHeaders: []string{"X-Forwarded-For", "X-Real-IP"}, - TrustedProxies: []string{"0.0.0.0/0"}, - AppEngine: defaultAppEngine, + TrustedPlatform: defaultPlatform, UseRawPath: false, RemoveExtraSlash: false, UnescapePathValues: true, @@ -168,6 +181,8 @@ func New() *Engine { trees: make(methodTrees, 0, 9), delims: render.Delims{Left: "{{", Right: "}}"}, secureJSONPrefix: "while(1);", + trustedProxies: []string{"0.0.0.0/0"}, + trustedCIDRs: defaultTrustedCIDRs, } engine.RouterGroup.engine = engine engine.pool.New = func() interface{} { @@ -186,7 +201,8 @@ func Default() *Engine { func (engine *Engine) allocateContext() *Context { v := make(Params, 0, engine.maxParams) - return &Context{engine: engine, params: &v} + skippedNodes := make([]skippedNode, 0, engine.maxSections) + return &Context{engine: engine, params: &v, skippedNodes: &skippedNodes} } // Delims sets template left and right delims and returns a Engine instance. @@ -249,7 +265,7 @@ func (engine *Engine) NoRoute(handlers ...HandlerFunc) { engine.rebuild404Handlers() } -// NoMethod sets the handlers called when... TODO. +// NoMethod sets the handlers called when Engine.HandleMethodNotAllowed = true. func (engine *Engine) NoMethod(handlers ...HandlerFunc) { engine.noMethod = handlers engine.rebuild405Handlers() @@ -292,6 +308,10 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) { if paramsCount := countParams(path); paramsCount > engine.maxParams { engine.maxParams = paramsCount } + + if sectionsCount := countSections(path); sectionsCount > engine.maxSections { + engine.maxSections = sectionsCount + } } // Routes returns a slice of registered routes, including some useful information, such as: @@ -326,11 +346,11 @@ func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo { func (engine *Engine) Run(addr ...string) (err error) { defer func() { debugPrintError(err) }() - trustedCIDRs, err := engine.prepareTrustedCIDRs() - if err != nil { - return err + if engine.isUnsafeTrustedProxies() { + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") } - engine.trustedCIDRs = trustedCIDRs + address := resolveAddress(addr) debugPrint("Listening and serving HTTP on %s\n", address) err = http.ListenAndServe(address, engine) @@ -338,12 +358,12 @@ func (engine *Engine) Run(addr ...string) (err error) { } func (engine *Engine) prepareTrustedCIDRs() ([]*net.IPNet, error) { - if engine.TrustedProxies == nil { + if engine.trustedProxies == nil { return nil, nil } - cidr := make([]*net.IPNet, 0, len(engine.TrustedProxies)) - for _, trustedProxy := range engine.TrustedProxies { + cidr := make([]*net.IPNet, 0, len(engine.trustedProxies)) + for _, trustedProxy := range engine.trustedProxies { if !strings.Contains(trustedProxy, "/") { ip := parseIP(trustedProxy) if ip == nil { @@ -366,6 +386,31 @@ func (engine *Engine) prepareTrustedCIDRs() ([]*net.IPNet, error) { return cidr, nil } +// SetTrustedProxies set a list of network origins (IPv4 addresses, +// IPv4 CIDRs, IPv6 addresses or IPv6 CIDRs) from which to trust +// request's headers that contain alternative client IP when +// `(*gin.Engine).ForwardedByClientIP` is `true`. `TrustedProxies` +// feature is enabled by default, and it also trusts all proxies +// by default. If you want to disable this feature, use +// Engine.SetTrustedProxies(nil), then Context.ClientIP() will +// return the remote address directly. +func (engine *Engine) SetTrustedProxies(trustedProxies []string) error { + engine.trustedProxies = trustedProxies + return engine.parseTrustedProxies() +} + +// isUnsafeTrustedProxies compares Engine.trustedCIDRs and defaultTrustedCIDRs, it's not safe if equal (returns true) +func (engine *Engine) isUnsafeTrustedProxies() bool { + return reflect.DeepEqual(engine.trustedCIDRs, defaultTrustedCIDRs) +} + +// parseTrustedProxies parse Engine.trustedProxies to Engine.trustedCIDRs +func (engine *Engine) parseTrustedProxies() error { + trustedCIDRs, err := engine.prepareTrustedCIDRs() + engine.trustedCIDRs = trustedCIDRs + return err +} + // parseIP parse a string representation of an IP and returns a net.IP with the // minimum byte representation or nil if input is invalid. func parseIP(ip string) net.IP { @@ -387,6 +432,11 @@ func (engine *Engine) RunTLS(addr, certFile, keyFile string) (err error) { debugPrint("Listening and serving HTTPS on %s\n", addr) defer func() { debugPrintError(err) }() + if engine.isUnsafeTrustedProxies() { + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") + } + err = http.ListenAndServeTLS(addr, certFile, keyFile, engine) return } @@ -398,6 +448,11 @@ func (engine *Engine) RunUnix(file string) (err error) { debugPrint("Listening and serving HTTP on unix:/%s", file) defer func() { debugPrintError(err) }() + if engine.isUnsafeTrustedProxies() { + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") + } + listener, err := net.Listen("unix", file) if err != nil { return @@ -416,6 +471,11 @@ func (engine *Engine) RunFd(fd int) (err error) { debugPrint("Listening and serving HTTP on fd@%d", fd) defer func() { debugPrintError(err) }() + if engine.isUnsafeTrustedProxies() { + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") + } + f := os.NewFile(uintptr(fd), fmt.Sprintf("fd@%d", fd)) listener, err := net.FileListener(f) if err != nil { @@ -431,6 +491,12 @@ func (engine *Engine) RunFd(fd int) (err error) { func (engine *Engine) RunListener(listener net.Listener) (err error) { debugPrint("Listening and serving HTTP on listener what's bind with address@%s", listener.Addr()) defer func() { debugPrintError(err) }() + + if engine.isUnsafeTrustedProxies() { + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") + } + err = http.Serve(listener, engine) return } @@ -479,7 +545,7 @@ func (engine *Engine) handleHTTPRequest(c *Context) { } root := t[i].root // Find route in tree - value := root.getValue(rPath, c.params, unescape) + value := root.getValue(rPath, c.params, c.skippedNodes, unescape) if value.params != nil { c.Params = *value.params } @@ -507,7 +573,7 @@ func (engine *Engine) handleHTTPRequest(c *Context) { if tree.method == httpMethod { continue } - if value := tree.root.getValue(rPath, nil, unescape); value.handlers != nil { + if value := tree.root.getValue(rPath, nil, c.skippedNodes, unescape); value.handlers != nil { c.handlers = engine.allNoMethod serveError(c, http.StatusMethodNotAllowed, default405Body) return diff --git a/vendor/github.com/gin-gonic/gin/go.mod b/vendor/github.com/gin-gonic/gin/go.mod index 884ff85..33d546a 100644 --- a/vendor/github.com/gin-gonic/gin/go.mod +++ b/vendor/github.com/gin-gonic/gin/go.mod @@ -12,3 +12,5 @@ require ( github.com/ugorji/go/codec v1.1.7 gopkg.in/yaml.v2 v2.2.8 ) + +retract v1.7.5 diff --git a/vendor/github.com/gin-gonic/gin/mode.go b/vendor/github.com/gin-gonic/gin/mode.go index 4d199df..c8813af 100644 --- a/vendor/github.com/gin-gonic/gin/mode.go +++ b/vendor/github.com/gin-gonic/gin/mode.go @@ -41,10 +41,8 @@ var DefaultWriter io.Writer = os.Stdout // DefaultErrorWriter is the default io.Writer used by Gin to debug errors var DefaultErrorWriter io.Writer = os.Stderr -var ( - ginMode = debugCode - modeName = DebugMode -) +var ginMode = debugCode +var modeName = DebugMode func init() { mode := os.Getenv(EnvGinMode) diff --git a/vendor/github.com/gin-gonic/gin/recovery.go b/vendor/github.com/gin-gonic/gin/recovery.go index dd72c74..563f5aa 100644 --- a/vendor/github.com/gin-gonic/gin/recovery.go +++ b/vendor/github.com/gin-gonic/gin/recovery.go @@ -34,7 +34,7 @@ func Recovery() HandlerFunc { return RecoveryWithWriter(DefaultErrorWriter) } -// CustomRecovery returns a middleware that recovers from any panics and calls the provided handle func to handle it. +//CustomRecovery returns a middleware that recovers from any panics and calls the provided handle func to handle it. func CustomRecovery(handle RecoveryFunc) HandlerFunc { return RecoveryWithWriter(DefaultErrorWriter, handle) } diff --git a/vendor/github.com/gin-gonic/gin/render/html.go b/vendor/github.com/gin-gonic/gin/render/html.go index 902604d..6696ece 100644 --- a/vendor/github.com/gin-gonic/gin/render/html.go +++ b/vendor/github.com/gin-gonic/gin/render/html.go @@ -63,7 +63,6 @@ func (r HTMLDebug) Instance(name string, data interface{}) Render { Data: data, } } - func (r HTMLDebug) loadTemplate() *template.Template { if r.FuncMap == nil { r.FuncMap = template.FuncMap{} diff --git a/vendor/github.com/gin-gonic/gin/render/json.go b/vendor/github.com/gin-gonic/gin/render/json.go index e25415b..4186309 100644 --- a/vendor/github.com/gin-gonic/gin/render/json.go +++ b/vendor/github.com/gin-gonic/gin/render/json.go @@ -46,11 +46,9 @@ type PureJSON struct { Data interface{} } -var ( - jsonContentType = []string{"application/json; charset=utf-8"} - jsonpContentType = []string{"application/javascript; charset=utf-8"} - jsonAsciiContentType = []string{"application/json"} -) +var jsonContentType = []string{"application/json; charset=utf-8"} +var jsonpContentType = []string{"application/javascript; charset=utf-8"} +var jsonAsciiContentType = []string{"application/json"} // Render (JSON) writes data with custom ContentType. func (r JSON) Render(w http.ResponseWriter) (err error) { diff --git a/vendor/github.com/gin-gonic/gin/render/msgpack.go b/vendor/github.com/gin-gonic/gin/render/msgpack.go index bf0bbaa..6ef5b6e 100644 --- a/vendor/github.com/gin-gonic/gin/render/msgpack.go +++ b/vendor/github.com/gin-gonic/gin/render/msgpack.go @@ -13,7 +13,9 @@ import ( "github.com/ugorji/go/codec" ) -var _ Render = MsgPack{} +var ( + _ Render = MsgPack{} +) // MsgPack contains the given interface object. type MsgPack struct { diff --git a/vendor/github.com/gin-gonic/gin/tree.go b/vendor/github.com/gin-gonic/gin/tree.go index 0d082d0..158a339 100644 --- a/vendor/github.com/gin-gonic/gin/tree.go +++ b/vendor/github.com/gin-gonic/gin/tree.go @@ -17,6 +17,7 @@ import ( var ( strColon = []byte(":") strStar = []byte("*") + strSlash = []byte("/") ) // Param is a single URL parameter, consisting of a key and a value. @@ -98,6 +99,11 @@ func countParams(path string) uint16 { return n } +func countSections(path string) uint16 { + s := bytesconv.StringToBytes(path) + return uint16(bytes.Count(s, strSlash)) +} + type nodeType uint8 const ( @@ -118,11 +124,6 @@ type node struct { fullPath string } -type skip struct { - path string - paramNode *node -} - // Increments priority of the given child and reorders if necessary func (n *node) incrementChildPrio(pos int) int { cs := n.children @@ -399,13 +400,19 @@ type nodeValue struct { fullPath string } +type skippedNode struct { + path string + node *node + paramsCount int16 +} + // Returns the handle registered with the given path (key). The values of // wildcards are saved to a map. // If no handle can be found, a TSR (trailing slash redirect) recommendation is // made if a handle exists with an extra (without the) trailing slash for the // given path. -func (n *node) getValue(path string, params *Params, unescape bool) (value nodeValue) { - var skipped *skip +func (n *node) getValue(path string, params *Params, skippedNodes *[]skippedNode, unescape bool) (value nodeValue) { + var globalParamsCount int16 walk: // Outer loop for walking the tree for { @@ -418,10 +425,13 @@ walk: // Outer loop for walking the tree idxc := path[0] for i, c := range []byte(n.indices) { if c == idxc { - if strings.HasPrefix(n.children[len(n.children)-1].path, ":") { - skipped = &skip{ + // strings.HasPrefix(n.children[len(n.children)-1].path, ":") == n.wildChild + if n.wildChild { + index := len(*skippedNodes) + *skippedNodes = (*skippedNodes)[:index+1] + (*skippedNodes)[index] = skippedNode{ path: prefix + path, - paramNode: &node{ + node: &node{ path: n.path, wildChild: n.wildChild, nType: n.nType, @@ -430,6 +440,7 @@ walk: // Outer loop for walking the tree handlers: n.handlers, fullPath: n.fullPath, }, + paramsCount: globalParamsCount, } } @@ -438,20 +449,41 @@ walk: // Outer loop for walking the tree } } - // If there is no wildcard pattern, recommend a redirection if !n.wildChild { + // If the path at the end of the loop is not equal to '/' and the current node has no child nodes + // the current node needs to roll back to last vaild skippedNode + if path != "/" { + for l := len(*skippedNodes); l > 0; { + skippedNode := (*skippedNodes)[l-1] + *skippedNodes = (*skippedNodes)[:l-1] + if strings.HasSuffix(skippedNode.path, path) { + path = skippedNode.path + n = skippedNode.node + if value.params != nil { + *value.params = (*value.params)[:skippedNode.paramsCount] + } + globalParamsCount = skippedNode.paramsCount + continue walk + } + } + } + // Nothing found. // We can recommend to redirect to the same URL without a // trailing slash if a leaf exists for that path. - value.tsr = (path == "/" && n.handlers != nil) + value.tsr = path == "/" && n.handlers != nil return } // Handle wildcard child, which is always at the end of the array n = n.children[len(n.children)-1] + globalParamsCount++ switch n.nType { case param: + // fix truncate the parameter + // tree_test.go line: 204 + // Find param end (either '/' or path end) end := 0 for end < len(path) && path[end] != '/' { @@ -459,7 +491,7 @@ walk: // Outer loop for walking the tree } // Save param value - if params != nil { + if params != nil && cap(*params) > 0 { if value.params == nil { value.params = params } @@ -487,7 +519,7 @@ walk: // Outer loop for walking the tree } // ... but we can't - value.tsr = (len(path) == end+1) + value.tsr = len(path) == end+1 return } @@ -499,7 +531,7 @@ walk: // Outer loop for walking the tree // No handle found. Check if a handle for this path + a // trailing slash exists for TSR recommendation n = n.children[0] - value.tsr = (n.path == "/" && n.handlers != nil) + value.tsr = n.path == "/" && n.handlers != nil } return @@ -535,6 +567,24 @@ walk: // Outer loop for walking the tree } if path == prefix { + // If the current path does not equal '/' and the node does not have a registered handle and the most recently matched node has a child node + // the current node needs to roll back to last vaild skippedNode + if n.handlers == nil && path != "/" { + for l := len(*skippedNodes); l > 0; { + skippedNode := (*skippedNodes)[l-1] + *skippedNodes = (*skippedNodes)[:l-1] + if strings.HasSuffix(skippedNode.path, path) { + path = skippedNode.path + n = skippedNode.node + if value.params != nil { + *value.params = (*value.params)[:skippedNode.paramsCount] + } + globalParamsCount = skippedNode.paramsCount + continue walk + } + } + // n = latestNode.children[len(latestNode.children)-1] + } // We should have reached the node containing the handle. // Check if this node has a handle registered. if value.handlers = n.handlers; value.handlers != nil { @@ -564,18 +614,29 @@ walk: // Outer loop for walking the tree return } - if path != "/" && skipped != nil && strings.HasSuffix(skipped.path, path) { - path = skipped.path - n = skipped.paramNode - skipped = nil - continue walk - } - // Nothing found. We can recommend to redirect to the same URL with an // extra trailing slash if a leaf exists for that path - value.tsr = (path == "/") || + value.tsr = path == "/" || (len(prefix) == len(path)+1 && prefix[len(path)] == '/' && path == prefix[:len(prefix)-1] && n.handlers != nil) + + // roll back to last valid skippedNode + if !value.tsr && path != "/" { + for l := len(*skippedNodes); l > 0; { + skippedNode := (*skippedNodes)[l-1] + *skippedNodes = (*skippedNodes)[:l-1] + if strings.HasSuffix(skippedNode.path, path) { + path = skippedNode.path + n = skippedNode.node + if value.params != nil { + *value.params = (*value.params)[:skippedNode.paramsCount] + } + globalParamsCount = skippedNode.paramsCount + continue walk + } + } + } + return } } diff --git a/vendor/github.com/gin-gonic/gin/version.go b/vendor/github.com/gin-gonic/gin/version.go index a80ab69..4b69b9b 100644 --- a/vendor/github.com/gin-gonic/gin/version.go +++ b/vendor/github.com/gin-gonic/gin/version.go @@ -5,4 +5,4 @@ package gin // Version is the current gin framework's version. -const Version = "v1.7.2" +const Version = "v1.7.7" diff --git a/vendor/github.com/go-logr/zapr/zapr.go b/vendor/github.com/go-logr/zapr/zapr.go index f7a140f..0969a4a 100644 --- a/vendor/github.com/go-logr/zapr/zapr.go +++ b/vendor/github.com/go-logr/zapr/zapr.go @@ -182,7 +182,5 @@ func NewLogger(l *zap.Logger) logr.Logger { return newLoggerWithExtraSkip(l, 1) } -var ( - _ logr.Logger = &zapLogger{} - _ logr.CallDepthLogger = &zapLogger{} -) +var _ logr.Logger = &zapLogger{} +var _ logr.CallDepthLogger = &zapLogger{} diff --git a/vendor/github.com/go-playground/locales/rules.go b/vendor/github.com/go-playground/locales/rules.go index 29a3755..9202900 100644 --- a/vendor/github.com/go-playground/locales/rules.go +++ b/vendor/github.com/go-playground/locales/rules.go @@ -156,6 +156,7 @@ type Translator interface { // String returns the string value of PluralRule func (p PluralRule) String() string { + switch p { case PluralRuleZero: return pluralsString[7:11] @@ -224,6 +225,7 @@ func (p PluralRule) String() string { // W returns the number of visible fraction digits in N, without trailing zeros. func W(n float64, v uint64) (w int64) { + s := strconv.FormatFloat(n-float64(int64(n)), 'f', int(v), 64) // with either be '0' or '0.xxxx', so if 1 then w will be zero @@ -248,11 +250,13 @@ func W(n float64, v uint64) (w int64) { // F returns the visible fractional digits in N, with trailing zeros. func F(n float64, v uint64) (f int64) { + s := strconv.FormatFloat(n-float64(int64(n)), 'f', int(v), 64) // with either be '0' or '0.xxxx', so if 1 then f will be zero // otherwise need to parse if len(s) != 1 { + // ignoring error, because it can't fail as we generated // the string internally from a real number f, _ = strconv.ParseInt(s[2:], 10, 64) @@ -263,6 +267,7 @@ func F(n float64, v uint64) (f int64) { // T returns the visible fractional digits in N, without trailing zeros. func T(n float64, v uint64) (t int64) { + s := strconv.FormatFloat(n-float64(int64(n)), 'f', int(v), 64) // with either be '0' or '0.xxxx', so if 1 then t will be zero diff --git a/vendor/github.com/go-playground/universal-translator/errors.go b/vendor/github.com/go-playground/universal-translator/errors.go index 4fbb187..38b163b 100644 --- a/vendor/github.com/go-playground/universal-translator/errors.go +++ b/vendor/github.com/go-playground/universal-translator/errors.go @@ -7,18 +7,18 @@ import ( "github.com/go-playground/locales" ) -// ErrUnknowTranslation indicates the translation could not be found -var ErrUnknowTranslation = errors.New("Unknown Translation") - var ( - _ error = new(ErrConflictingTranslation) - _ error = new(ErrRangeTranslation) - _ error = new(ErrOrdinalTranslation) - _ error = new(ErrCardinalTranslation) - _ error = new(ErrMissingPluralTranslation) - _ error = new(ErrExistingTranslator) + // ErrUnknowTranslation indicates the translation could not be found + ErrUnknowTranslation = errors.New("Unknown Translation") ) +var _ error = new(ErrConflictingTranslation) +var _ error = new(ErrRangeTranslation) +var _ error = new(ErrOrdinalTranslation) +var _ error = new(ErrCardinalTranslation) +var _ error = new(ErrMissingPluralTranslation) +var _ error = new(ErrExistingTranslator) + // ErrExistingTranslator is the error representing a conflicting translator type ErrExistingTranslator struct { locale string @@ -39,6 +39,7 @@ type ErrConflictingTranslation struct { // Error returns ErrConflictingTranslation's internal error text func (e *ErrConflictingTranslation) Error() string { + if _, ok := e.key.(string); !ok { return fmt.Sprintf("error: conflicting key '%#v' rule '%s' with text '%s' for locale '%s', value being ignored", e.key, e.rule, e.text, e.locale) } @@ -87,6 +88,7 @@ type ErrMissingPluralTranslation struct { // Error returns ErrMissingPluralTranslation's internal error text func (e *ErrMissingPluralTranslation) Error() string { + if _, ok := e.key.(string); !ok { return fmt.Sprintf("error: missing '%s' plural rule '%s' for translation with key '%#v' and locale '%s'", e.translationType, e.rule, e.key, e.locale) } diff --git a/vendor/github.com/go-playground/universal-translator/import_export.go b/vendor/github.com/go-playground/universal-translator/import_export.go index dc7f1a8..7bd76f2 100644 --- a/vendor/github.com/go-playground/universal-translator/import_export.go +++ b/vendor/github.com/go-playground/universal-translator/import_export.go @@ -3,11 +3,12 @@ package ut import ( "encoding/json" "fmt" - "io" "io/ioutil" "os" "path/filepath" + "io" + "github.com/go-playground/locales" ) @@ -38,6 +39,7 @@ const ( // // NOTE: this currently only works with string or int translations keys. func (t *UniversalTranslator) Export(format ImportExportFormat, dirname string) error { + _, err := os.Stat(dirname) fmt.Println(dirname, err, os.IsNotExist(err)) if err != nil { @@ -67,6 +69,7 @@ func (t *UniversalTranslator) Export(format ImportExportFormat, dirname string) } for k, pluralTrans := range locale.(*translator).cardinalTanslations { + for i, plural := range pluralTrans { // leave enough for all plural rules @@ -86,6 +89,7 @@ func (t *UniversalTranslator) Export(format ImportExportFormat, dirname string) } for k, pluralTrans := range locale.(*translator).ordinalTanslations { + for i, plural := range pluralTrans { // leave enough for all plural rules @@ -105,6 +109,7 @@ func (t *UniversalTranslator) Export(format ImportExportFormat, dirname string) } for k, pluralTrans := range locale.(*translator).rangeTanslations { + for i, plural := range pluralTrans { // leave enough for all plural rules @@ -148,12 +153,14 @@ func (t *UniversalTranslator) Export(format ImportExportFormat, dirname string) // // NOTE: this currently only works with string or int translations keys. func (t *UniversalTranslator) Import(format ImportExportFormat, dirnameOrFilename string) error { + fi, err := os.Stat(dirnameOrFilename) if err != nil { return err } processFn := func(filename string) error { + f, err := os.Open(filename) if err != nil { return err @@ -169,6 +176,7 @@ func (t *UniversalTranslator) Import(format ImportExportFormat, dirnameOrFilenam // recursively go through directory walker := func(path string, info os.FileInfo, err error) error { + if info.IsDir() { return nil } @@ -191,6 +199,7 @@ func (t *UniversalTranslator) Import(format ImportExportFormat, dirnameOrFilenam // // NOTE: generally used when assets have been embedded into the binary and are already in memory. func (t *UniversalTranslator) ImportByReader(format ImportExportFormat, reader io.Reader) error { + b, err := ioutil.ReadAll(reader) if err != nil { return err @@ -246,6 +255,7 @@ func (t *UniversalTranslator) ImportByReader(format ImportExportFormat, reader i } func stringToPR(s string) locales.PluralRule { + switch s { case "One": return locales.PluralRuleOne @@ -260,4 +270,5 @@ func stringToPR(s string) locales.PluralRule { default: return locales.PluralRuleUnknown } + } diff --git a/vendor/github.com/go-playground/universal-translator/translator.go b/vendor/github.com/go-playground/universal-translator/translator.go index cf22bf2..cfafce8 100644 --- a/vendor/github.com/go-playground/universal-translator/translator.go +++ b/vendor/github.com/go-playground/universal-translator/translator.go @@ -66,10 +66,8 @@ type Translator interface { VerifyTranslations() error } -var ( - _ Translator = new(translator) - _ locales.Translator = new(translator) -) +var _ Translator = new(translator) +var _ locales.Translator = new(translator) type translator struct { locales.Translator @@ -98,6 +96,7 @@ func newTranslator(trans locales.Translator) Translator { // {#} is the only replacement type accepted and are ad infinitum // eg. one: '{0} day left' other: '{0} days left' func (t *translator) Add(key interface{}, text string, override bool) error { + if _, ok := t.translations[key]; ok && !override { return &ErrConflictingTranslation{locale: t.Locale(), key: key, text: text} } @@ -137,6 +136,7 @@ func (t *translator) Add(key interface{}, text string, override bool) error { // see AddRange below. // eg. in locale 'en' one: '{0} day left' other: '{0} days left' func (t *translator) AddCardinal(key interface{}, text string, rule locales.PluralRule, override bool) error { + var verified bool // verify plural rule exists for locale @@ -157,6 +157,7 @@ func (t *translator) AddCardinal(key interface{}, text string, rule locales.Plur if len(tarr) > 0 && tarr[rule] != nil && !override { return &ErrConflictingTranslation{locale: t.Locale(), key: key, rule: rule, text: text} } + } else { tarr = make([]*transText, 7, 7) t.cardinalTanslations[key] = tarr @@ -187,6 +188,7 @@ func (t *translator) AddCardinal(key interface{}, text string, rule locales.Plur // see AddRange below. // eg. in locale 'en' one: '{0}st day of spring' other: '{0}nd day of spring' - 1st, 2nd, 3rd... func (t *translator) AddOrdinal(key interface{}, text string, rule locales.PluralRule, override bool) error { + var verified bool // verify plural rule exists for locale @@ -207,6 +209,7 @@ func (t *translator) AddOrdinal(key interface{}, text string, rule locales.Plura if len(tarr) > 0 && tarr[rule] != nil && !override { return &ErrConflictingTranslation{locale: t.Locale(), key: key, rule: rule, text: text} } + } else { tarr = make([]*transText, 7, 7) t.ordinalTanslations[key] = tarr @@ -235,6 +238,7 @@ func (t *translator) AddOrdinal(key interface{}, text string, rule locales.Plura // {0} and {1} are the only replacement types accepted and only these are accepted. // eg. in locale 'nl' one: '{0}-{1} day left' other: '{0}-{1} days left' func (t *translator) AddRange(key interface{}, text string, rule locales.PluralRule, override bool) error { + var verified bool // verify plural rule exists for locale @@ -255,6 +259,7 @@ func (t *translator) AddRange(key interface{}, text string, rule locales.PluralR if len(tarr) > 0 && tarr[rule] != nil && !override { return &ErrConflictingTranslation{locale: t.Locale(), key: key, rule: rule, text: text} } + } else { tarr = make([]*transText, 7, 7) t.rangeTanslations[key] = tarr @@ -290,6 +295,7 @@ func (t *translator) AddRange(key interface{}, text string, rule locales.PluralR // T creates the translation for the locale given the 'key' and params passed in func (t *translator) T(key interface{}, params ...string) (string, error) { + trans, ok := t.translations[key] if !ok { return unknownTranslation, ErrUnknowTranslation @@ -315,6 +321,7 @@ func (t *translator) T(key interface{}, params ...string) (string, error) { // C creates the cardinal translation for the locale given the 'key', 'num' and 'digit' arguments and param passed in func (t *translator) C(key interface{}, num float64, digits uint64, param string) (string, error) { + tarr, ok := t.cardinalTanslations[key] if !ok { return unknownTranslation, ErrUnknowTranslation @@ -334,6 +341,7 @@ func (t *translator) C(key interface{}, num float64, digits uint64, param string // O creates the ordinal translation for the locale given the 'key', 'num' and 'digit' arguments and param passed in func (t *translator) O(key interface{}, num float64, digits uint64, param string) (string, error) { + tarr, ok := t.ordinalTanslations[key] if !ok { return unknownTranslation, ErrUnknowTranslation @@ -354,6 +362,7 @@ func (t *translator) O(key interface{}, num float64, digits uint64, param string // R creates the range translation for the locale given the 'key', 'num1', 'digit1', 'num2' and 'digit2' arguments // and 'param1' and 'param2' passed in func (t *translator) R(key interface{}, num1 float64, digits1 uint64, num2 float64, digits2 uint64, param1, param2 string) (string, error) { + tarr, ok := t.rangeTanslations[key] if !ok { return unknownTranslation, ErrUnknowTranslation @@ -376,8 +385,11 @@ func (t *translator) R(key interface{}, num1 float64, digits1 uint64, num2 float // VerifyTranslations checks to ensures that no plural rules have been // missed within the translations. func (t *translator) VerifyTranslations() error { + for k, v := range t.cardinalTanslations { + for _, rule := range t.PluralsCardinal() { + if v[rule] == nil { return &ErrMissingPluralTranslation{locale: t.Locale(), translationType: "plural", rule: rule, key: k} } @@ -385,7 +397,9 @@ func (t *translator) VerifyTranslations() error { } for k, v := range t.ordinalTanslations { + for _, rule := range t.PluralsOrdinal() { + if v[rule] == nil { return &ErrMissingPluralTranslation{locale: t.Locale(), translationType: "ordinal", rule: rule, key: k} } @@ -393,7 +407,9 @@ func (t *translator) VerifyTranslations() error { } for k, v := range t.rangeTanslations { + for _, rule := range t.PluralsRange() { + if v[rule] == nil { return &ErrMissingPluralTranslation{locale: t.Locale(), translationType: "range", rule: rule, key: k} } diff --git a/vendor/github.com/go-playground/universal-translator/universal_translator.go b/vendor/github.com/go-playground/universal-translator/universal_translator.go index ed2bf23..dbf707f 100644 --- a/vendor/github.com/go-playground/universal-translator/universal_translator.go +++ b/vendor/github.com/go-playground/universal-translator/universal_translator.go @@ -15,6 +15,7 @@ type UniversalTranslator struct { // New returns a new UniversalTranslator instance set with // the fallback locale and locales it should support func New(fallback locales.Translator, supportedLocales ...locales.Translator) *UniversalTranslator { + t := &UniversalTranslator{ translators: make(map[string]Translator), } @@ -40,7 +41,9 @@ func New(fallback locales.Translator, supportedLocales ...locales.Translator) *U // and returns the first one it can find, otherwise returns the // fallback translator. func (t *UniversalTranslator) FindTranslator(locales ...string) (trans Translator, found bool) { + for _, locale := range locales { + if trans, found = t.translators[strings.ToLower(locale)]; found { return } @@ -52,6 +55,7 @@ func (t *UniversalTranslator) FindTranslator(locales ...string) (trans Translato // GetTranslator returns the specified translator for the given locale, // or fallback if not found func (t *UniversalTranslator) GetTranslator(locale string) (trans Translator, found bool) { + if trans, found = t.translators[strings.ToLower(locale)]; found { return } @@ -69,6 +73,7 @@ func (t *UniversalTranslator) GetFallback() Translator { // overridden; if the fallback matches the supplied translator it will be overridden as well // NOTE: this is normally only used when translator is embedded within a library func (t *UniversalTranslator) AddTranslator(translator locales.Translator, override bool) error { + lc := strings.ToLower(translator.Locale()) _, ok := t.translators[lc] if ok && !override { @@ -96,6 +101,7 @@ func (t *UniversalTranslator) AddTranslator(translator locales.Translator, overr // VerifyTranslations runs through all locales and identifies any issues // eg. missing plural rules for a locale func (t *UniversalTranslator) VerifyTranslations() (err error) { + for _, trans := range t.translators { err = trans.VerifyTranslations() if err != nil { diff --git a/vendor/github.com/go-playground/validator/v10/baked_in.go b/vendor/github.com/go-playground/validator/v10/baked_in.go index c6e45b8..6ce762d 100644 --- a/vendor/github.com/go-playground/validator/v10/baked_in.go +++ b/vendor/github.com/go-playground/validator/v10/baked_in.go @@ -191,10 +191,8 @@ var ( } ) -var ( - oneofValsCache = map[string][]string{} - oneofValsCacheRWLock = sync.RWMutex{} -) +var oneofValsCache = map[string][]string{} +var oneofValsCacheRWLock = sync.RWMutex{} func parseOneOfParam2(s string) []string { oneofValsCacheRWLock.RLock() @@ -250,6 +248,7 @@ func isOneOf(fl FieldLevel) bool { // isUnique is the validation function for validating if each array|slice|map value is unique func isUnique(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() v := reflect.ValueOf(struct{}{}) @@ -299,6 +298,7 @@ func isUnique(fl FieldLevel) bool { // IsMAC is the validation function for validating if the field's value is a valid MAC address. func isMAC(fl FieldLevel) bool { + _, err := net.ParseMAC(fl.Field().String()) return err == nil @@ -306,6 +306,7 @@ func isMAC(fl FieldLevel) bool { // IsCIDRv4 is the validation function for validating if the field's value is a valid v4 CIDR address. func isCIDRv4(fl FieldLevel) bool { + ip, _, err := net.ParseCIDR(fl.Field().String()) return err == nil && ip.To4() != nil @@ -313,6 +314,7 @@ func isCIDRv4(fl FieldLevel) bool { // IsCIDRv6 is the validation function for validating if the field's value is a valid v6 CIDR address. func isCIDRv6(fl FieldLevel) bool { + ip, _, err := net.ParseCIDR(fl.Field().String()) return err == nil && ip.To4() == nil @@ -320,6 +322,7 @@ func isCIDRv6(fl FieldLevel) bool { // IsCIDR is the validation function for validating if the field's value is a valid v4 or v6 CIDR address. func isCIDR(fl FieldLevel) bool { + _, _, err := net.ParseCIDR(fl.Field().String()) return err == nil @@ -327,6 +330,7 @@ func isCIDR(fl FieldLevel) bool { // IsIPv4 is the validation function for validating if a value is a valid v4 IP address. func isIPv4(fl FieldLevel) bool { + ip := net.ParseIP(fl.Field().String()) return ip != nil && ip.To4() != nil @@ -334,6 +338,7 @@ func isIPv4(fl FieldLevel) bool { // IsIPv6 is the validation function for validating if the field's value is a valid v6 IP address. func isIPv6(fl FieldLevel) bool { + ip := net.ParseIP(fl.Field().String()) return ip != nil && ip.To4() == nil @@ -341,6 +346,7 @@ func isIPv6(fl FieldLevel) bool { // IsIP is the validation function for validating if the field's value is a valid v4 or v6 IP address. func isIP(fl FieldLevel) bool { + ip := net.ParseIP(fl.Field().String()) return ip != nil @@ -348,6 +354,7 @@ func isIP(fl FieldLevel) bool { // IsSSN is the validation function for validating if the field's value is a valid SSN. func isSSN(fl FieldLevel) bool { + field := fl.Field() if field.Len() != 11 { @@ -405,6 +412,7 @@ func isLatitude(fl FieldLevel) bool { // IsDataURI is the validation function for validating if the field's value is a valid data URI. func isDataURI(fl FieldLevel) bool { + uri := strings.SplitN(fl.Field().String(), ",", 2) if len(uri) != 2 { @@ -420,6 +428,7 @@ func isDataURI(fl FieldLevel) bool { // HasMultiByteCharacter is the validation function for validating if the field's value has a multi byte character. func hasMultiByteCharacter(fl FieldLevel) bool { + field := fl.Field() if field.Len() == 0 { @@ -486,6 +495,7 @@ func isISBN(fl FieldLevel) bool { // IsISBN13 is the validation function for validating if the field's value is a valid v13 ISBN. func isISBN13(fl FieldLevel) bool { + s := strings.Replace(strings.Replace(fl.Field().String(), "-", "", 4), " ", "", 4) if !iSBN13Regex.MatchString(s) { @@ -506,6 +516,7 @@ func isISBN13(fl FieldLevel) bool { // IsISBN10 is the validation function for validating if the field's value is a valid v10 ISBN. func isISBN10(fl FieldLevel) bool { + s := strings.Replace(strings.Replace(fl.Field().String(), "-", "", 3), " ", "", 3) if !iSBN10Regex.MatchString(s) { @@ -693,6 +704,7 @@ func excludes(fl FieldLevel) bool { // ContainsRune is the validation function for validating that the field's value contains the rune specified within the param. func containsRune(fl FieldLevel) bool { + r, _ := utf8.DecodeRuneInString(fl.Param()) return strings.ContainsRune(fl.Field().String(), r) @@ -755,6 +767,7 @@ func fieldExcludes(fl FieldLevel) bool { // IsNeField is the validation function for validating if the current field's value is not equal to the field specified by the param's value. func isNeField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -808,6 +821,7 @@ func isNe(fl FieldLevel) bool { // IsLteCrossStructField is the validation function for validating if the current field's value is less than or equal to the field, within a separate struct, specified by the param's value. func isLteCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -855,6 +869,7 @@ func isLteCrossStructField(fl FieldLevel) bool { // IsLtCrossStructField is the validation function for validating if the current field's value is less than the field, within a separate struct, specified by the param's value. // NOTE: This is exposed for use within your own custom functions and not intended to be called directly. func isLtCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -901,6 +916,7 @@ func isLtCrossStructField(fl FieldLevel) bool { // IsGteCrossStructField is the validation function for validating if the current field's value is greater than or equal to the field, within a separate struct, specified by the param's value. func isGteCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -947,6 +963,7 @@ func isGteCrossStructField(fl FieldLevel) bool { // IsGtCrossStructField is the validation function for validating if the current field's value is greater than the field, within a separate struct, specified by the param's value. func isGtCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -993,6 +1010,7 @@ func isGtCrossStructField(fl FieldLevel) bool { // IsNeCrossStructField is the validation function for validating that the current field's value is not equal to the field, within a separate struct, specified by the param's value. func isNeCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1039,6 +1057,7 @@ func isNeCrossStructField(fl FieldLevel) bool { // IsEqCrossStructField is the validation function for validating that the current field's value is equal to the field, within a separate struct, specified by the param's value. func isEqCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1085,6 +1104,7 @@ func isEqCrossStructField(fl FieldLevel) bool { // IsEqField is the validation function for validating if the current field's value is equal to the field specified by the param's value. func isEqField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1132,6 +1152,7 @@ func isEqField(fl FieldLevel) bool { // IsEq is the validation function for validating if the current field's value is equal to the param's value. func isEq(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1181,9 +1202,11 @@ func isBase64URL(fl FieldLevel) bool { // IsURI is the validation function for validating if the current field's value is a valid URI. func isURI(fl FieldLevel) bool { + field := fl.Field() switch field.Kind() { + case reflect.String: s := field.String() @@ -1208,9 +1231,11 @@ func isURI(fl FieldLevel) bool { // IsURL is the validation function for validating if the current field's value is a valid URL. func isURL(fl FieldLevel) bool { + field := fl.Field() switch field.Kind() { + case reflect.String: var i int @@ -1243,6 +1268,7 @@ func isUrnRFC2141(fl FieldLevel) bool { field := fl.Field() switch field.Kind() { + case reflect.String: str := field.String() @@ -1544,6 +1570,7 @@ func requiredWithoutAll(fl FieldLevel) bool { // IsGteField is the validation function for validating if the current field's value is greater than or equal to the field specified by the param's value. func isGteField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1590,6 +1617,7 @@ func isGteField(fl FieldLevel) bool { // IsGtField is the validation function for validating if the current field's value is greater than the field specified by the param's value. func isGtField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1636,6 +1664,7 @@ func isGtField(fl FieldLevel) bool { // IsGte is the validation function for validating if the current field's value is greater than or equal to the param's value. func isGte(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1682,6 +1711,7 @@ func isGte(fl FieldLevel) bool { // IsGt is the validation function for validating if the current field's value is greater than the param's value. func isGt(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1714,6 +1744,7 @@ func isGt(fl FieldLevel) bool { case reflect.Struct: if field.Type() == timeType { + return field.Interface().(time.Time).After(time.Now().UTC()) } } @@ -1723,6 +1754,7 @@ func isGt(fl FieldLevel) bool { // HasLengthOf is the validation function for validating if the current field's value is equal to the param's value. func hasLengthOf(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1764,6 +1796,7 @@ func hasMinOf(fl FieldLevel) bool { // IsLteField is the validation function for validating if the current field's value is less than or equal to the field specified by the param's value. func isLteField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1810,6 +1843,7 @@ func isLteField(fl FieldLevel) bool { // IsLtField is the validation function for validating if the current field's value is less than the field specified by the param's value. func isLtField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1856,6 +1890,7 @@ func isLtField(fl FieldLevel) bool { // IsLte is the validation function for validating if the current field's value is less than or equal to the param's value. func isLte(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1902,6 +1937,7 @@ func isLte(fl FieldLevel) bool { // IsLt is the validation function for validating if the current field's value is less than the param's value. func isLt(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1935,6 +1971,7 @@ func isLt(fl FieldLevel) bool { case reflect.Struct: if field.Type() == timeType { + return field.Interface().(time.Time).Before(time.Now().UTC()) } } @@ -1949,6 +1986,7 @@ func hasMaxOf(fl FieldLevel) bool { // IsTCP4AddrResolvable is the validation function for validating if the field's value is a resolvable tcp4 address. func isTCP4AddrResolvable(fl FieldLevel) bool { + if !isIP4Addr(fl) { return false } @@ -1959,6 +1997,7 @@ func isTCP4AddrResolvable(fl FieldLevel) bool { // IsTCP6AddrResolvable is the validation function for validating if the field's value is a resolvable tcp6 address. func isTCP6AddrResolvable(fl FieldLevel) bool { + if !isIP6Addr(fl) { return false } @@ -1970,6 +2009,7 @@ func isTCP6AddrResolvable(fl FieldLevel) bool { // IsTCPAddrResolvable is the validation function for validating if the field's value is a resolvable tcp address. func isTCPAddrResolvable(fl FieldLevel) bool { + if !isIP4Addr(fl) && !isIP6Addr(fl) { return false } @@ -1981,6 +2021,7 @@ func isTCPAddrResolvable(fl FieldLevel) bool { // IsUDP4AddrResolvable is the validation function for validating if the field's value is a resolvable udp4 address. func isUDP4AddrResolvable(fl FieldLevel) bool { + if !isIP4Addr(fl) { return false } @@ -1992,6 +2033,7 @@ func isUDP4AddrResolvable(fl FieldLevel) bool { // IsUDP6AddrResolvable is the validation function for validating if the field's value is a resolvable udp6 address. func isUDP6AddrResolvable(fl FieldLevel) bool { + if !isIP6Addr(fl) { return false } @@ -2003,6 +2045,7 @@ func isUDP6AddrResolvable(fl FieldLevel) bool { // IsUDPAddrResolvable is the validation function for validating if the field's value is a resolvable udp address. func isUDPAddrResolvable(fl FieldLevel) bool { + if !isIP4Addr(fl) && !isIP6Addr(fl) { return false } @@ -2014,6 +2057,7 @@ func isUDPAddrResolvable(fl FieldLevel) bool { // IsIP4AddrResolvable is the validation function for validating if the field's value is a resolvable ip4 address. func isIP4AddrResolvable(fl FieldLevel) bool { + if !isIPv4(fl) { return false } @@ -2025,6 +2069,7 @@ func isIP4AddrResolvable(fl FieldLevel) bool { // IsIP6AddrResolvable is the validation function for validating if the field's value is a resolvable ip6 address. func isIP6AddrResolvable(fl FieldLevel) bool { + if !isIPv6(fl) { return false } @@ -2036,6 +2081,7 @@ func isIP6AddrResolvable(fl FieldLevel) bool { // IsIPAddrResolvable is the validation function for validating if the field's value is a resolvable ip address. func isIPAddrResolvable(fl FieldLevel) bool { + if !isIP(fl) { return false } @@ -2047,12 +2093,14 @@ func isIPAddrResolvable(fl FieldLevel) bool { // IsUnixAddrResolvable is the validation function for validating if the field's value is a resolvable unix address. func isUnixAddrResolvable(fl FieldLevel) bool { + _, err := net.ResolveUnixAddr("unix", fl.Field().String()) return err == nil } func isIP4Addr(fl FieldLevel) bool { + val := fl.Field().String() if idx := strings.LastIndex(val, ":"); idx != -1 { @@ -2065,6 +2113,7 @@ func isIP4Addr(fl FieldLevel) bool { } func isIP6Addr(fl FieldLevel) bool { + val := fl.Field().String() if idx := strings.LastIndex(val, ":"); idx != -1 { diff --git a/vendor/github.com/go-playground/validator/v10/country_codes.go b/vendor/github.com/go-playground/validator/v10/country_codes.go index b0f145f..ef81ead 100644 --- a/vendor/github.com/go-playground/validator/v10/country_codes.go +++ b/vendor/github.com/go-playground/validator/v10/country_codes.go @@ -107,7 +107,6 @@ var iso3166_1_alpha3 = map[string]bool{ "VNM": true, "VGB": true, "VIR": true, "WLF": true, "ESH": true, "YEM": true, "ZMB": true, "ZWE": true, "ALA": true, } - var iso3166_1_alpha_numeric = map[int]bool{ // see: https://www.iso.org/iso-3166-country-codes.html 4: true, 8: true, 12: true, 16: true, 20: true, diff --git a/vendor/github.com/go-playground/validator/v10/doc.go b/vendor/github.com/go-playground/validator/v10/doc.go index 34f22ad..a816c20 100644 --- a/vendor/github.com/go-playground/validator/v10/doc.go +++ b/vendor/github.com/go-playground/validator/v10/doc.go @@ -1228,7 +1228,7 @@ Although empty value and Local value are allowed by time.LoadLocation golang fun More information on https://golang.org/pkg/time/#LoadLocation Usage: timezone - + Alias Validators and Tags diff --git a/vendor/github.com/go-playground/validator/v10/errors.go b/vendor/github.com/go-playground/validator/v10/errors.go index 5a4dce2..63293cf 100644 --- a/vendor/github.com/go-playground/validator/v10/errors.go +++ b/vendor/github.com/go-playground/validator/v10/errors.go @@ -24,6 +24,7 @@ type InvalidValidationError struct { // Error returns InvalidValidationError message func (e *InvalidValidationError) Error() string { + if e.Type == nil { return "validator: (nil)" } @@ -40,6 +41,7 @@ type ValidationErrors []FieldError // All information to create an error message specific to your application is contained within // the FieldError found within the ValidationErrors array func (ve ValidationErrors) Error() string { + buff := bytes.NewBufferString("") var fe *fieldError @@ -56,6 +58,7 @@ func (ve ValidationErrors) Error() string { // Translate translates all of the ValidationErrors func (ve ValidationErrors) Translate(ut ut.Translator) ValidationErrorsTranslations { + trans := make(ValidationErrorsTranslations) var fe *fieldError @@ -158,10 +161,8 @@ type FieldError interface { } // compile time interface checks -var ( - _ FieldError = new(fieldError) - _ error = new(fieldError) -) +var _ FieldError = new(fieldError) +var _ error = new(fieldError) // fieldError contains a single field's validation error along // with other properties that may be needed for error message creation @@ -206,6 +207,7 @@ func (fe *fieldError) StructNamespace() string { // Field returns the field's name with the tag name taking precedence over the // field's actual name. func (fe *fieldError) Field() string { + return fe.ns[len(fe.ns)-int(fe.fieldLen):] // // return fe.field // fld := fe.ns[len(fe.ns)-int(fe.fieldLen):] @@ -258,6 +260,7 @@ func (fe *fieldError) Error() string { // NOTE: if no registered translation can be found, it returns the original // untranslated error message. func (fe *fieldError) Translate(ut ut.Translator) string { + m, ok := fe.v.transTagFunc[ut] if !ok { return fe.Error() diff --git a/vendor/github.com/go-playground/validator/v10/struct_level.go b/vendor/github.com/go-playground/validator/v10/struct_level.go index 5f55597..57691ee 100644 --- a/vendor/github.com/go-playground/validator/v10/struct_level.go +++ b/vendor/github.com/go-playground/validator/v10/struct_level.go @@ -107,6 +107,7 @@ func (v *validate) ExtractType(field reflect.Value) (reflect.Value, reflect.Kind // ReportError reports an error just by passing the field and tag information func (v *validate) ReportError(field interface{}, fieldName, structFieldName, tag, param string) { + fv, kind, _ := v.extractTypeInternal(reflect.ValueOf(field), false) if len(structFieldName) == 0 { @@ -160,6 +161,7 @@ func (v *validate) ReportError(field interface{}, fieldName, structFieldName, ta // // NOTE: this function prepends the current namespace to the relative ones. func (v *validate) ReportValidationErrors(relativeNamespace, relativeStructNamespace string, errs ValidationErrors) { + var err *fieldError for i := 0; i < len(errs); i++ { diff --git a/vendor/github.com/go-playground/validator/v10/util.go b/vendor/github.com/go-playground/validator/v10/util.go index 02b110d..56420f4 100644 --- a/vendor/github.com/go-playground/validator/v10/util.go +++ b/vendor/github.com/go-playground/validator/v10/util.go @@ -11,6 +11,7 @@ import ( // It will dive into pointers, customTypes and return you the // underlying value and it's kind. func (v *validate) extractTypeInternal(current reflect.Value, nullable bool) (reflect.Value, reflect.Kind, bool) { + BEGIN: switch current.Kind() { case reflect.Ptr: @@ -41,6 +42,7 @@ BEGIN: default: if v.v.hasCustomFuncs { + if fn, ok := v.v.customFuncs[current.Type()]; ok { current = reflect.ValueOf(fn(current)) goto BEGIN @@ -57,6 +59,7 @@ BEGIN: // NOTE: when not successful ok will be false, this can happen when a nested struct is nil and so the field // could not be retrieved because it didn't exist. func (v *validate) getStructFieldOKInternal(val reflect.Value, namespace string) (current reflect.Value, kind reflect.Kind, nullable bool, found bool) { + BEGIN: current, kind, nullable = v.ExtractType(val) if kind == reflect.Invalid { @@ -251,6 +254,7 @@ func asIntFromType(t reflect.Type, param string) int64 { // asUint returns the parameter as a uint64 // or panics if it can't convert func asUint(param string) uint64 { + i, err := strconv.ParseUint(param, 0, 64) panicIf(err) @@ -260,6 +264,7 @@ func asUint(param string) uint64 { // asFloat returns the parameter as a float64 // or panics if it can't convert func asFloat(param string) float64 { + i, err := strconv.ParseFloat(param, 64) panicIf(err) @@ -269,6 +274,7 @@ func asFloat(param string) float64 { // asBool returns the parameter as a bool // or panics if it can't convert func asBool(param string) bool { + i, err := strconv.ParseBool(param) panicIf(err) diff --git a/vendor/github.com/go-playground/validator/v10/validator.go b/vendor/github.com/go-playground/validator/v10/validator.go index 4c0a2ba..f097f39 100644 --- a/vendor/github.com/go-playground/validator/v10/validator.go +++ b/vendor/github.com/go-playground/validator/v10/validator.go @@ -31,6 +31,7 @@ type validate struct { // parent and current will be the same the first run of validateStruct func (v *validate) validateStruct(ctx context.Context, parent reflect.Value, current reflect.Value, typ reflect.Type, ns []byte, structNs []byte, ct *cTag) { + cs, ok := v.v.structCache.Get(typ) if !ok { cs = v.v.extractStructCache(current, typ.Name()) @@ -56,11 +57,13 @@ func (v *validate) validateStruct(ctx context.Context, parent reflect.Value, cur f = cs.fields[i] if v.isPartial { + if v.ffn != nil { // used with StructFiltered if v.ffn(append(structNs, f.name...)) { continue } + } else { // used with StructPartial & StructExcept _, ok = v.includeExclude[string(append(structNs, f.name...))] @@ -352,6 +355,7 @@ OUTER: v.ct = ct if ct.fn(ctx, v) { + // drain rest of the 'or' values, then continue or leave for { @@ -386,6 +390,7 @@ OUTER: } if ct.hasAlias { + v.errs = append(v.errs, &fieldError{ v: v.v, @@ -401,6 +406,7 @@ OUTER: typ: typ, }, ) + } else { tVal := string(v.misc)[1:] @@ -467,4 +473,5 @@ OUTER: ct = ct.next } } + } diff --git a/vendor/github.com/go-playground/validator/v10/validator_instance.go b/vendor/github.com/go-playground/validator/v10/validator_instance.go index b88f485..fe6a487 100644 --- a/vendor/github.com/go-playground/validator/v10/validator_instance.go +++ b/vendor/github.com/go-playground/validator/v10/validator_instance.go @@ -86,6 +86,7 @@ type Validate struct { // New returns a new instance of 'validate' with sane defaults. func New() *Validate { + tc := new(tagCache) tc.m.Store(make(map[string]*cTag)) @@ -107,6 +108,7 @@ func New() *Validate { // must copy validators for separate validations to be used in each instance for k, val := range bakedInValidators { + switch k { // these require that even if the value is nil that the validation should run, omitempty still overrides this behaviour case requiredIfTag, requiredUnlessTag, requiredWithTag, requiredWithAllTag, requiredWithoutTag, requiredWithoutAllTag: @@ -194,6 +196,7 @@ func (v *Validate) registerValidation(tag string, fn FuncCtx, bakedIn bool, nilC // // NOTE: this function is not thread-safe it is intended that these all be registered prior to any validation func (v *Validate) RegisterAlias(alias, tags string) { + _, ok := restrictedTags[alias] if ok || strings.ContainsAny(alias, restrictedTagChars) { @@ -217,6 +220,7 @@ func (v *Validate) RegisterStructValidation(fn StructLevelFunc, types ...interfa // NOTE: // - this method is not thread-safe it is intended that these all be registered prior to any validation func (v *Validate) RegisterStructValidationCtx(fn StructLevelFuncCtx, types ...interface{}) { + if v.structLevelFuncs == nil { v.structLevelFuncs = make(map[reflect.Type]StructLevelFuncCtx) } @@ -235,6 +239,7 @@ func (v *Validate) RegisterStructValidationCtx(fn StructLevelFuncCtx, types ...i // // NOTE: this method is not thread-safe it is intended that these all be registered prior to any validation func (v *Validate) RegisterCustomTypeFunc(fn CustomTypeFunc, types ...interface{}) { + if v.customFuncs == nil { v.customFuncs = make(map[reflect.Type]CustomTypeFunc) } @@ -248,6 +253,7 @@ func (v *Validate) RegisterCustomTypeFunc(fn CustomTypeFunc, types ...interface{ // RegisterTranslation registers translations against the provided tag. func (v *Validate) RegisterTranslation(tag string, trans ut.Translator, registerFn RegisterTranslationsFunc, translationFn TranslationFunc) (err error) { + if v.transTagFunc == nil { v.transTagFunc = make(map[ut.Translator]map[string]TranslationFunc) } @@ -281,6 +287,7 @@ func (v *Validate) Struct(s interface{}) error { // It returns InvalidValidationError for bad values passed in and nil or ValidationErrors as error otherwise. // You will need to assert the error if it's not nil eg. err.(validator.ValidationErrors) to access the array of errors. func (v *Validate) StructCtx(ctx context.Context, s interface{}) (err error) { + val := reflect.ValueOf(s) top := val diff --git a/vendor/github.com/golang/protobuf/proto/proto.go b/vendor/github.com/golang/protobuf/proto/proto.go index 2ff784f..5aee89c 100644 --- a/vendor/github.com/golang/protobuf/proto/proto.go +++ b/vendor/github.com/golang/protobuf/proto/proto.go @@ -114,7 +114,6 @@ func (e *RequiredNotSetError) Error() string { } return "proto: required field not set" } - func (e *RequiredNotSetError) RequiredNotSet() bool { return true } diff --git a/vendor/github.com/golang/protobuf/proto/registry.go b/vendor/github.com/golang/protobuf/proto/registry.go index 76e0d2f..1e7ff64 100644 --- a/vendor/github.com/golang/protobuf/proto/registry.go +++ b/vendor/github.com/golang/protobuf/proto/registry.go @@ -92,10 +92,8 @@ type enumsByName = map[string]int32 // enumsByNumber maps enum values by number to their name counterpart. type enumsByNumber = map[int32]string -var ( - enumCache sync.Map // map[enumName]enumsByName - numFilesCache sync.Map // map[protoreflect.FullName]int -) +var enumCache sync.Map // map[enumName]enumsByName +var numFilesCache sync.Map // map[protoreflect.FullName]int // RegisterEnum is called from the generated code to register the mapping of // enum value names to enum numbers for the enum identified by s. diff --git a/vendor/github.com/hashicorp/hcl/decoder.go b/vendor/github.com/hashicorp/hcl/decoder.go index 933a1fc..bed9ebb 100644 --- a/vendor/github.com/hashicorp/hcl/decoder.go +++ b/vendor/github.com/hashicorp/hcl/decoder.go @@ -16,8 +16,10 @@ import ( // This is the tag to use with structures to have settings for HCL const tagName = "hcl" -// nodeType holds a reference to the type of ast.Node -var nodeType reflect.Type = findNodeType() +var ( + // nodeType holds a reference to the type of ast.Node + nodeType reflect.Type = findNodeType() +) // Unmarshal accepts a byte slice as input and writes the // data to the value pointed to by v. @@ -481,12 +483,12 @@ func expandObject(node ast.Node, result reflect.Value) ast.Node { case reflect.Ptr: switch elemType.Elem().Kind() { case reflect.Struct: - // OK + //OK default: return node } case reflect.Struct: - // OK + //OK default: return node } @@ -503,7 +505,7 @@ func expandObject(node ast.Node, result reflect.Value) ast.Node { // we need to un-flatten the ast enough to decode newNode := &ast.ObjectItem{ Keys: []*ast.ObjectKey{ - { + &ast.ObjectKey{ Token: keyToken, }, }, diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go b/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go index 98ae049..7c038d1 100644 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go @@ -16,7 +16,9 @@ const ( infinity = 1 << 30 // offset or line ) -var unindent = []byte("\uE123") // in the private use space +var ( + unindent = []byte("\uE123") // in the private use space +) type printer struct { cfg Config diff --git a/vendor/github.com/jacobweinstock/registrar/registrar.go b/vendor/github.com/jacobweinstock/registrar/registrar.go index e4fbaf6..563205a 100644 --- a/vendor/github.com/jacobweinstock/registrar/registrar.go +++ b/vendor/github.com/jacobweinstock/registrar/registrar.go @@ -56,7 +56,7 @@ func WithDrivers(drivers Drivers) Option { // NewRegistry returns a new Driver registry func NewRegistry(opts ...Option) *Registry { - defaultRegistry := &Registry{ + var defaultRegistry = &Registry{ Logger: defaultLogger(), } for _, opt := range opts { @@ -93,7 +93,7 @@ func (r Registry) GetDriverInterfaces() []interface{} { // interface. registered drivers must implement the Verifier interface for this. func (r Registry) FilterForCompatible(ctx context.Context) Drivers { var wg sync.WaitGroup - mutex := &sync.Mutex{} + var mutex = &sync.Mutex{} state := make(map[int]*Driver) for index, elem := range r.Drivers { diff --git a/vendor/github.com/jmespath/go-jmespath/functions.go b/vendor/github.com/jmespath/go-jmespath/functions.go index 019cd82..9b7cd89 100644 --- a/vendor/github.com/jmespath/go-jmespath/functions.go +++ b/vendor/github.com/jmespath/go-jmespath/functions.go @@ -50,11 +50,9 @@ type byExprString struct { func (a *byExprString) Len() int { return len(a.items) } - func (a *byExprString) Swap(i, j int) { a.items[i], a.items[j] = a.items[j], a.items[i] } - func (a *byExprString) Less(i, j int) bool { first, err := a.intr.Execute(a.node, a.items[i]) if err != nil { @@ -91,11 +89,9 @@ type byExprFloat struct { func (a *byExprFloat) Len() int { return len(a.items) } - func (a *byExprFloat) Swap(i, j int) { a.items[i], a.items[j] = a.items[j], a.items[i] } - func (a *byExprFloat) Less(i, j int) bool { first, err := a.intr.Execute(a.node, a.items[i]) if err != nil { @@ -440,12 +436,10 @@ func jpfAvg(arguments []interface{}) (interface{}, error) { } return numerator / length, nil } - func jpfCeil(arguments []interface{}) (interface{}, error) { val := arguments[0].(float64) return math.Ceil(val), nil } - func jpfContains(arguments []interface{}) (interface{}, error) { search := arguments[0] el := arguments[1] @@ -464,18 +458,15 @@ func jpfContains(arguments []interface{}) (interface{}, error) { } return false, nil } - func jpfEndsWith(arguments []interface{}) (interface{}, error) { search := arguments[0].(string) suffix := arguments[1].(string) return strings.HasSuffix(search, suffix), nil } - func jpfFloor(arguments []interface{}) (interface{}, error) { val := arguments[0].(float64) return math.Floor(val), nil } - func jpfMap(arguments []interface{}) (interface{}, error) { intr := arguments[0].(*treeInterpreter) exp := arguments[1].(expRef) @@ -491,7 +482,6 @@ func jpfMap(arguments []interface{}) (interface{}, error) { } return mapped, nil } - func jpfMax(arguments []interface{}) (interface{}, error) { if items, ok := toArrayNum(arguments[0]); ok { if len(items) == 0 { @@ -524,7 +514,6 @@ func jpfMax(arguments []interface{}) (interface{}, error) { } return best, nil } - func jpfMerge(arguments []interface{}) (interface{}, error) { final := make(map[string]interface{}) for _, m := range arguments { @@ -535,7 +524,6 @@ func jpfMerge(arguments []interface{}) (interface{}, error) { } return final, nil } - func jpfMaxBy(arguments []interface{}) (interface{}, error) { intr := arguments[0].(*treeInterpreter) arr := arguments[1].([]interface{}) @@ -591,7 +579,6 @@ func jpfMaxBy(arguments []interface{}) (interface{}, error) { return nil, errors.New("invalid type, must be number of string") } } - func jpfSum(arguments []interface{}) (interface{}, error) { items, _ := toArrayNum(arguments[0]) sum := 0.0 @@ -687,7 +674,6 @@ func jpfMinBy(arguments []interface{}) (interface{}, error) { return nil, errors.New("invalid type, must be number of string") } } - func jpfType(arguments []interface{}) (interface{}, error) { arg := arguments[0] if _, ok := arg.(float64); ok { @@ -710,7 +696,6 @@ func jpfType(arguments []interface{}) (interface{}, error) { } return nil, errors.New("unknown type") } - func jpfKeys(arguments []interface{}) (interface{}, error) { arg := arguments[0].(map[string]interface{}) collected := make([]interface{}, 0, len(arg)) @@ -719,7 +704,6 @@ func jpfKeys(arguments []interface{}) (interface{}, error) { } return collected, nil } - func jpfValues(arguments []interface{}) (interface{}, error) { arg := arguments[0].(map[string]interface{}) collected := make([]interface{}, 0, len(arg)) @@ -728,7 +712,6 @@ func jpfValues(arguments []interface{}) (interface{}, error) { } return collected, nil } - func jpfSort(arguments []interface{}) (interface{}, error) { if items, ok := toArrayNum(arguments[0]); ok { d := sort.Float64Slice(items) @@ -749,7 +732,6 @@ func jpfSort(arguments []interface{}) (interface{}, error) { } return final, nil } - func jpfSortBy(arguments []interface{}) (interface{}, error) { intr := arguments[0].(*treeInterpreter) arr := arguments[1].([]interface{}) @@ -782,7 +764,6 @@ func jpfSortBy(arguments []interface{}) (interface{}, error) { return nil, errors.New("invalid type, must be number of string") } } - func jpfJoin(arguments []interface{}) (interface{}, error) { sep := arguments[0].(string) // We can't just do arguments[1].([]string), we have to @@ -793,7 +774,6 @@ func jpfJoin(arguments []interface{}) (interface{}, error) { } return strings.Join(arrayStr, sep), nil } - func jpfReverse(arguments []interface{}) (interface{}, error) { if s, ok := arguments[0].(string); ok { r := []rune(s) @@ -810,14 +790,12 @@ func jpfReverse(arguments []interface{}) (interface{}, error) { } return reversed, nil } - func jpfToArray(arguments []interface{}) (interface{}, error) { if _, ok := arguments[0].([]interface{}); ok { return arguments[0], nil } return arguments[:1:1], nil } - func jpfToString(arguments []interface{}) (interface{}, error) { if v, ok := arguments[0].(string); ok { return v, nil @@ -828,7 +806,6 @@ func jpfToString(arguments []interface{}) (interface{}, error) { } return string(result), nil } - func jpfToNumber(arguments []interface{}) (interface{}, error) { arg := arguments[0] if v, ok := arg.(float64); ok { @@ -855,7 +832,6 @@ func jpfToNumber(arguments []interface{}) (interface{}, error) { } return nil, errors.New("unknown type") } - func jpfNotNull(arguments []interface{}) (interface{}, error) { for _, arg := range arguments { if arg != nil { diff --git a/vendor/github.com/jmespath/go-jmespath/parser.go b/vendor/github.com/jmespath/go-jmespath/parser.go index 2e2e425..4abc303 100644 --- a/vendor/github.com/jmespath/go-jmespath/parser.go +++ b/vendor/github.com/jmespath/go-jmespath/parser.go @@ -362,7 +362,7 @@ func (p *Parser) nud(token token) (ASTNode, error) { return ASTNode{nodeType: ASTProjection, children: []ASTNode{left, right}}, nil case tLbracket: tokenType := p.current() - // var right ASTNode + //var right ASTNode if tokenType == tNumber || tokenType == tColon { right, err := p.parseIndexExpression() if err != nil { @@ -496,7 +496,6 @@ func (p *Parser) projectIfSlice(left ASTNode, right ASTNode) (ASTNode, error) { } return indexExpr, nil } - func (p *Parser) parseFilter(node ASTNode) (ASTNode, error) { var right, condition ASTNode var err error diff --git a/vendor/github.com/json-iterator/go/any.go b/vendor/github.com/json-iterator/go/any.go index 9277e23..f6b8aea 100644 --- a/vendor/github.com/json-iterator/go/any.go +++ b/vendor/github.com/json-iterator/go/any.go @@ -3,12 +3,11 @@ package jsoniter import ( "errors" "fmt" + "github.com/modern-go/reflect2" "io" "reflect" "strconv" "unsafe" - - "github.com/modern-go/reflect2" ) // Any generic object representation. @@ -304,7 +303,8 @@ func (codec *anyCodec) IsEmpty(ptr unsafe.Pointer) bool { return any.Size() == 0 } -type directAnyCodec struct{} +type directAnyCodec struct { +} func (codec *directAnyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { *(*Any)(ptr) = iter.readAny() diff --git a/vendor/github.com/json-iterator/go/any_str.go b/vendor/github.com/json-iterator/go/any_str.go index 0c8580b..1f12f66 100644 --- a/vendor/github.com/json-iterator/go/any_str.go +++ b/vendor/github.com/json-iterator/go/any_str.go @@ -50,6 +50,7 @@ func (any *stringAny) ToBool() bool { func (any *stringAny) ToInt() int { return int(any.ToInt64()) + } func (any *stringAny) ToInt32() int32 { diff --git a/vendor/github.com/json-iterator/go/config.go b/vendor/github.com/json-iterator/go/config.go index 27c1074..2adcdc3 100644 --- a/vendor/github.com/json-iterator/go/config.go +++ b/vendor/github.com/json-iterator/go/config.go @@ -211,7 +211,6 @@ func (cfg *frozenConfig) useNumber(extension DecoderExtension) { } }} } - func (cfg *frozenConfig) getTagKey() string { tagKey := cfg.configBeforeFrozen.TagKey if tagKey == "" { @@ -226,7 +225,8 @@ func (cfg *frozenConfig) RegisterExtension(extension Extension) { cfg.configBeforeFrozen = copied } -type lossyFloat32Encoder struct{} +type lossyFloat32Encoder struct { +} func (encoder *lossyFloat32Encoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteFloat32Lossy(*((*float32)(ptr))) @@ -236,7 +236,8 @@ func (encoder *lossyFloat32Encoder) IsEmpty(ptr unsafe.Pointer) bool { return *((*float32)(ptr)) == 0 } -type lossyFloat64Encoder struct{} +type lossyFloat64Encoder struct { +} func (encoder *lossyFloat64Encoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteFloat64Lossy(*((*float64)(ptr))) @@ -254,7 +255,8 @@ func (cfg *frozenConfig) marshalFloatWith6Digits(extension EncoderExtension) { extension[reflect2.TypeOfPtr((*float64)(nil)).Elem()] = &lossyFloat64Encoder{} } -type htmlEscapedStringEncoder struct{} +type htmlEscapedStringEncoder struct { +} func (encoder *htmlEscapedStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { str := *((*string)(ptr)) diff --git a/vendor/github.com/json-iterator/go/iter.go b/vendor/github.com/json-iterator/go/iter.go index 11dc550..29b31cf 100644 --- a/vendor/github.com/json-iterator/go/iter.go +++ b/vendor/github.com/json-iterator/go/iter.go @@ -26,10 +26,8 @@ const ( ObjectValue ) -var ( - hexDigits []byte - valueTypes []ValueType -) +var hexDigits []byte +var valueTypes []ValueType func init() { hexDigits = make([]byte, 256) diff --git a/vendor/github.com/json-iterator/go/iter_float.go b/vendor/github.com/json-iterator/go/iter_float.go index c6cf4db..b975463 100644 --- a/vendor/github.com/json-iterator/go/iter_float.go +++ b/vendor/github.com/json-iterator/go/iter_float.go @@ -11,11 +11,9 @@ import ( var floatDigits []int8 -const ( - invalidCharForNumber = int8(-1) - endOfNumber = int8(-2) - dotInNumber = int8(-3) -) +const invalidCharForNumber = int8(-1) +const endOfNumber = int8(-2) +const dotInNumber = int8(-3) func init() { floatDigits = make([]int8, 256) @@ -68,7 +66,7 @@ func (iter *Iterator) ReadBigInt() (ret *big.Int) { return ret } -// ReadFloat32 read float32 +//ReadFloat32 read float32 func (iter *Iterator) ReadFloat32() (ret float32) { c := iter.nextToken() if c == '-' { diff --git a/vendor/github.com/json-iterator/go/iter_int.go b/vendor/github.com/json-iterator/go/iter_int.go index a5f54f9..2142320 100644 --- a/vendor/github.com/json-iterator/go/iter_int.go +++ b/vendor/github.com/json-iterator/go/iter_int.go @@ -7,10 +7,8 @@ import ( var intDigits []int8 -const ( - uint32SafeToMultiply10 = uint32(0xffffffff)/10 - 1 - uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1 -) +const uint32SafeToMultiply10 = uint32(0xffffffff)/10 - 1 +const uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1 func init() { intDigits = make([]int8, 256) @@ -146,8 +144,8 @@ func (iter *Iterator) readUint32(c byte) (ret uint32) { iter.assertInteger() return value*10 + uint32(ind2) } - // iter.head = i + 1 - // value = value * 100 + uint32(ind2) * 10 + uint32(ind3) + //iter.head = i + 1 + //value = value * 100 + uint32(ind2) * 10 + uint32(ind3) i++ ind4 := intDigits[iter.buf[i]] if ind4 == invalidCharForNumber { @@ -268,8 +266,8 @@ func (iter *Iterator) readUint64(c byte) (ret uint64) { iter.assertInteger() return value*10 + uint64(ind2) } - // iter.head = i + 1 - // value = value * 100 + uint32(ind2) * 10 + uint32(ind3) + //iter.head = i + 1 + //value = value * 100 + uint32(ind2) * 10 + uint32(ind3) i++ ind4 := intDigits[iter.buf[i]] if ind4 == invalidCharForNumber { diff --git a/vendor/github.com/json-iterator/go/reflect.go b/vendor/github.com/json-iterator/go/reflect.go index f9299fa..74974ba 100644 --- a/vendor/github.com/json-iterator/go/reflect.go +++ b/vendor/github.com/json-iterator/go/reflect.go @@ -246,7 +246,6 @@ func createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder { placeholder.encoder = encoder return encoder } - func _createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder { encoder := createEncoderOfJsonRawMessage(ctx, typ) if encoder != nil { diff --git a/vendor/github.com/json-iterator/go/reflect_array.go b/vendor/github.com/json-iterator/go/reflect_array.go index 7eb5b1d..13a0b7b 100644 --- a/vendor/github.com/json-iterator/go/reflect_array.go +++ b/vendor/github.com/json-iterator/go/reflect_array.go @@ -2,10 +2,9 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "io" "unsafe" - - "github.com/modern-go/reflect2" ) func decoderOfArray(ctx *ctx, typ reflect2.Type) ValDecoder { diff --git a/vendor/github.com/json-iterator/go/reflect_dynamic.go b/vendor/github.com/json-iterator/go/reflect_dynamic.go index 7652778..8b6bc8b 100644 --- a/vendor/github.com/json-iterator/go/reflect_dynamic.go +++ b/vendor/github.com/json-iterator/go/reflect_dynamic.go @@ -1,10 +1,9 @@ package jsoniter import ( + "github.com/modern-go/reflect2" "reflect" "unsafe" - - "github.com/modern-go/reflect2" ) type dynamicEncoder struct { @@ -20,7 +19,8 @@ func (encoder *dynamicEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.valType.UnsafeIndirect(ptr) == nil } -type efaceDecoder struct{} +type efaceDecoder struct { +} func (decoder *efaceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { pObj := (*interface{})(ptr) diff --git a/vendor/github.com/json-iterator/go/reflect_extension.go b/vendor/github.com/json-iterator/go/reflect_extension.go index 4b27e0f..74a97bf 100644 --- a/vendor/github.com/json-iterator/go/reflect_extension.go +++ b/vendor/github.com/json-iterator/go/reflect_extension.go @@ -2,22 +2,19 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "reflect" "sort" "strings" "unicode" "unsafe" - - "github.com/modern-go/reflect2" ) -var ( - typeDecoders = map[string]ValDecoder{} - fieldDecoders = map[string]ValDecoder{} - typeEncoders = map[string]ValEncoder{} - fieldEncoders = map[string]ValEncoder{} - extensions = []Extension{} -) +var typeDecoders = map[string]ValDecoder{} +var fieldDecoders = map[string]ValDecoder{} +var typeEncoders = map[string]ValEncoder{} +var fieldEncoders = map[string]ValEncoder{} +var extensions = []Extension{} // StructDescriptor describe how should we encode/decode the struct type StructDescriptor struct { @@ -59,7 +56,8 @@ type Extension interface { } // DummyExtension embed this type get dummy implementation for all methods of Extension -type DummyExtension struct{} +type DummyExtension struct { +} // UpdateStructDescriptor No-op func (extension *DummyExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) { @@ -255,7 +253,6 @@ func getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder { } return decoder } - func _getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder { for _, extension := range extensions { decoder := extension.CreateDecoder(typ) @@ -398,7 +395,6 @@ func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor { } return createStructDescriptor(ctx, typ, bindings, embeddedBindings) } - func createStructDescriptor(ctx *ctx, typ reflect2.Type, bindings []*Binding, embeddedBindings []*Binding) *StructDescriptor { structDescriptor := &StructDescriptor{ Type: typ, diff --git a/vendor/github.com/json-iterator/go/reflect_json_number.go b/vendor/github.com/json-iterator/go/reflect_json_number.go index 4835911..98d45c1 100644 --- a/vendor/github.com/json-iterator/go/reflect_json_number.go +++ b/vendor/github.com/json-iterator/go/reflect_json_number.go @@ -2,10 +2,9 @@ package jsoniter import ( "encoding/json" + "github.com/modern-go/reflect2" "strconv" "unsafe" - - "github.com/modern-go/reflect2" ) type Number string @@ -33,10 +32,8 @@ func CastJsonNumber(val interface{}) (string, bool) { return "", false } -var ( - jsonNumberType = reflect2.TypeOfPtr((*json.Number)(nil)).Elem() - jsoniterNumberType = reflect2.TypeOfPtr((*Number)(nil)).Elem() -) +var jsonNumberType = reflect2.TypeOfPtr((*json.Number)(nil)).Elem() +var jsoniterNumberType = reflect2.TypeOfPtr((*Number)(nil)).Elem() func createDecoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValDecoder { if typ.AssignableTo(jsonNumberType) { @@ -58,7 +55,8 @@ func createEncoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValEncoder { return nil } -type jsonNumberCodec struct{} +type jsonNumberCodec struct { +} func (codec *jsonNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { switch iter.WhatIsNext() { @@ -85,7 +83,8 @@ func (codec *jsonNumberCodec) IsEmpty(ptr unsafe.Pointer) bool { return len(*((*json.Number)(ptr))) == 0 } -type jsoniterNumberCodec struct{} +type jsoniterNumberCodec struct { +} func (codec *jsoniterNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { switch iter.WhatIsNext() { diff --git a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go index e59b816..f261993 100644 --- a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go +++ b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go @@ -2,15 +2,12 @@ package jsoniter import ( "encoding/json" - "unsafe" - "github.com/modern-go/reflect2" + "unsafe" ) -var ( - jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem() - jsoniterRawMessageType = reflect2.TypeOfPtr((*RawMessage)(nil)).Elem() -) +var jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem() +var jsoniterRawMessageType = reflect2.TypeOfPtr((*RawMessage)(nil)).Elem() func createEncoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValEncoder { if typ == jsonRawMessageType { @@ -32,7 +29,8 @@ func createDecoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValDecoder { return nil } -type jsonRawMessageCodec struct{} +type jsonRawMessageCodec struct { +} func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { *((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes()) @@ -46,7 +44,8 @@ func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool { return len(*((*json.RawMessage)(ptr))) == 0 } -type jsoniterRawMessageCodec struct{} +type jsoniterRawMessageCodec struct { +} func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { *((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes()) diff --git a/vendor/github.com/json-iterator/go/reflect_map.go b/vendor/github.com/json-iterator/go/reflect_map.go index 696194b..5829671 100644 --- a/vendor/github.com/json-iterator/go/reflect_map.go +++ b/vendor/github.com/json-iterator/go/reflect_map.go @@ -2,12 +2,11 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "io" "reflect" "sort" "unsafe" - - "github.com/modern-go/reflect2" ) func decoderOfMap(ctx *ctx, typ reflect2.Type) ValDecoder { diff --git a/vendor/github.com/json-iterator/go/reflect_marshaler.go b/vendor/github.com/json-iterator/go/reflect_marshaler.go index 1764723..3e21f37 100644 --- a/vendor/github.com/json-iterator/go/reflect_marshaler.go +++ b/vendor/github.com/json-iterator/go/reflect_marshaler.go @@ -8,12 +8,10 @@ import ( "github.com/modern-go/reflect2" ) -var ( - marshalerType = reflect2.TypeOfPtr((*json.Marshaler)(nil)).Elem() - unmarshalerType = reflect2.TypeOfPtr((*json.Unmarshaler)(nil)).Elem() - textMarshalerType = reflect2.TypeOfPtr((*encoding.TextMarshaler)(nil)).Elem() - textUnmarshalerType = reflect2.TypeOfPtr((*encoding.TextUnmarshaler)(nil)).Elem() -) +var marshalerType = reflect2.TypeOfPtr((*json.Marshaler)(nil)).Elem() +var unmarshalerType = reflect2.TypeOfPtr((*json.Unmarshaler)(nil)).Elem() +var textMarshalerType = reflect2.TypeOfPtr((*encoding.TextMarshaler)(nil)).Elem() +var textUnmarshalerType = reflect2.TypeOfPtr((*encoding.TextUnmarshaler)(nil)).Elem() func createDecoderOfMarshaler(ctx *ctx, typ reflect2.Type) ValDecoder { ptrType := reflect2.PtrTo(typ) diff --git a/vendor/github.com/json-iterator/go/reflect_native.go b/vendor/github.com/json-iterator/go/reflect_native.go index d66dd02..f88722d 100644 --- a/vendor/github.com/json-iterator/go/reflect_native.go +++ b/vendor/github.com/json-iterator/go/reflect_native.go @@ -202,7 +202,8 @@ func createDecoderOfNative(ctx *ctx, typ reflect2.Type) ValDecoder { return nil } -type stringCodec struct{} +type stringCodec struct { +} func (codec *stringCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { *((*string)(ptr)) = iter.ReadString() @@ -217,7 +218,8 @@ func (codec *stringCodec) IsEmpty(ptr unsafe.Pointer) bool { return *((*string)(ptr)) == "" } -type int8Codec struct{} +type int8Codec struct { +} func (codec *int8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -233,7 +235,8 @@ func (codec *int8Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int8)(ptr)) == 0 } -type int16Codec struct{} +type int16Codec struct { +} func (codec *int16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -249,7 +252,8 @@ func (codec *int16Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int16)(ptr)) == 0 } -type int32Codec struct{} +type int32Codec struct { +} func (codec *int32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -265,7 +269,8 @@ func (codec *int32Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int32)(ptr)) == 0 } -type int64Codec struct{} +type int64Codec struct { +} func (codec *int64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -281,7 +286,8 @@ func (codec *int64Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int64)(ptr)) == 0 } -type uint8Codec struct{} +type uint8Codec struct { +} func (codec *uint8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -297,7 +303,8 @@ func (codec *uint8Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint8)(ptr)) == 0 } -type uint16Codec struct{} +type uint16Codec struct { +} func (codec *uint16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -313,7 +320,8 @@ func (codec *uint16Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint16)(ptr)) == 0 } -type uint32Codec struct{} +type uint32Codec struct { +} func (codec *uint32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -329,7 +337,8 @@ func (codec *uint32Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint32)(ptr)) == 0 } -type uint64Codec struct{} +type uint64Codec struct { +} func (codec *uint64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -345,7 +354,8 @@ func (codec *uint64Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint64)(ptr)) == 0 } -type float32Codec struct{} +type float32Codec struct { +} func (codec *float32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -361,7 +371,8 @@ func (codec *float32Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*float32)(ptr)) == 0 } -type float64Codec struct{} +type float64Codec struct { +} func (codec *float64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { @@ -377,7 +388,8 @@ func (codec *float64Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*float64)(ptr)) == 0 } -type boolCodec struct{} +type boolCodec struct { +} func (codec *boolCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { diff --git a/vendor/github.com/json-iterator/go/reflect_optional.go b/vendor/github.com/json-iterator/go/reflect_optional.go index d71b037..fa71f47 100644 --- a/vendor/github.com/json-iterator/go/reflect_optional.go +++ b/vendor/github.com/json-iterator/go/reflect_optional.go @@ -1,9 +1,8 @@ package jsoniter import ( - "unsafe" - "github.com/modern-go/reflect2" + "unsafe" ) func decoderOfOptional(ctx *ctx, typ reflect2.Type) ValDecoder { @@ -31,12 +30,12 @@ func (decoder *OptionalDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { *((*unsafe.Pointer)(ptr)) = nil } else { if *((*unsafe.Pointer)(ptr)) == nil { - // pointer to null, we have to allocate memory to hold the value + //pointer to null, we have to allocate memory to hold the value newPtr := decoder.ValueType.UnsafeNew() decoder.ValueDecoder.Decode(newPtr, iter) *((*unsafe.Pointer)(ptr)) = newPtr } else { - // reuse existing instance + //reuse existing instance decoder.ValueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter) } } @@ -50,12 +49,12 @@ type dereferenceDecoder struct { func (decoder *dereferenceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if *((*unsafe.Pointer)(ptr)) == nil { - // pointer to null, we have to allocate memory to hold the value + //pointer to null, we have to allocate memory to hold the value newPtr := decoder.valueType.UnsafeNew() decoder.valueDecoder.Decode(newPtr, iter) *((*unsafe.Pointer)(ptr)) = newPtr } else { - // reuse existing instance + //reuse existing instance decoder.valueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter) } } diff --git a/vendor/github.com/json-iterator/go/reflect_slice.go b/vendor/github.com/json-iterator/go/reflect_slice.go index f363a71..9441d79 100644 --- a/vendor/github.com/json-iterator/go/reflect_slice.go +++ b/vendor/github.com/json-iterator/go/reflect_slice.go @@ -2,10 +2,9 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "io" "unsafe" - - "github.com/modern-go/reflect2" ) func decoderOfSlice(ctx *ctx, typ reflect2.Type) ValDecoder { diff --git a/vendor/github.com/json-iterator/go/reflect_struct_decoder.go b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go index b424b58..d7eb0eb 100644 --- a/vendor/github.com/json-iterator/go/reflect_struct_decoder.go +++ b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go @@ -111,12 +111,10 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldDecoder3 = fieldDecoder } } - return &threeFieldsStructDecoder{ - typ, + return &threeFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, - fieldName3, fieldDecoder3, - } + fieldName3, fieldDecoder3} case 4: var fieldName1 int64 var fieldName2 int64 @@ -147,13 +145,11 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldDecoder4 = fieldDecoder } } - return &fourFieldsStructDecoder{ - typ, + return &fourFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, - fieldName4, fieldDecoder4, - } + fieldName4, fieldDecoder4} case 5: var fieldName1 int64 var fieldName2 int64 @@ -189,14 +185,12 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldDecoder5 = fieldDecoder } } - return &fiveFieldsStructDecoder{ - typ, + return &fiveFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4, - fieldName5, fieldDecoder5, - } + fieldName5, fieldDecoder5} case 6: var fieldName1 int64 var fieldName2 int64 @@ -237,15 +231,13 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldDecoder6 = fieldDecoder } } - return &sixFieldsStructDecoder{ - typ, + return &sixFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, - fieldName6, fieldDecoder6, - } + fieldName6, fieldDecoder6} case 7: var fieldName1 int64 var fieldName2 int64 @@ -291,16 +283,14 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldDecoder7 = fieldDecoder } } - return &sevenFieldsStructDecoder{ - typ, + return &sevenFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6, - fieldName7, fieldDecoder7, - } + fieldName7, fieldDecoder7} case 8: var fieldName1 int64 var fieldName2 int64 @@ -351,8 +341,7 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldDecoder8 = fieldDecoder } } - return &eightFieldsStructDecoder{ - typ, + return &eightFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, @@ -360,8 +349,7 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldName5, fieldDecoder5, fieldName6, fieldDecoder6, fieldName7, fieldDecoder7, - fieldName8, fieldDecoder8, - } + fieldName8, fieldDecoder8} case 9: var fieldName1 int64 var fieldName2 int64 @@ -417,8 +405,7 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldDecoder9 = fieldDecoder } } - return &nineFieldsStructDecoder{ - typ, + return &nineFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, @@ -427,8 +414,7 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldName6, fieldDecoder6, fieldName7, fieldDecoder7, fieldName8, fieldDecoder8, - fieldName9, fieldDecoder9, - } + fieldName9, fieldDecoder9} case 10: var fieldName1 int64 var fieldName2 int64 @@ -489,8 +475,7 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldDecoder10 = fieldDecoder } } - return &tenFieldsStructDecoder{ - typ, + return &tenFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, @@ -500,8 +485,7 @@ func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structF fieldName7, fieldDecoder7, fieldName8, fieldDecoder8, fieldName9, fieldDecoder9, - fieldName10, fieldDecoder10, - } + fieldName10, fieldDecoder10} } return &generalStructDecoder{typ, fields, false} } diff --git a/vendor/github.com/json-iterator/go/reflect_struct_encoder.go b/vendor/github.com/json-iterator/go/reflect_struct_encoder.go index 46817a0..152e3ef 100644 --- a/vendor/github.com/json-iterator/go/reflect_struct_encoder.go +++ b/vendor/github.com/json-iterator/go/reflect_struct_encoder.go @@ -2,11 +2,10 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "io" "reflect" "unsafe" - - "github.com/modern-go/reflect2" ) func encoderOfStruct(ctx *ctx, typ reflect2.Type) ValEncoder { @@ -169,7 +168,8 @@ func (encoder *structEncoder) IsEmpty(ptr unsafe.Pointer) bool { return false } -type emptyStructEncoder struct{} +type emptyStructEncoder struct { +} func (encoder *emptyStructEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteEmptyObject() diff --git a/vendor/github.com/leodido/go-urn/machine.go b/vendor/github.com/leodido/go-urn/machine.go index 25ba623..fe5a0cc 100644 --- a/vendor/github.com/leodido/go-urn/machine.go +++ b/vendor/github.com/leodido/go-urn/machine.go @@ -13,15 +13,11 @@ var ( errParse = "parsing error [col %d]" ) -const ( - start int = 1 - firstFinal int = 44 -) +const start int = 1 +const firstFinal int = 44 -const ( - enFail int = 46 - enMain int = 1 -) +const enFail int = 46 +const enMain int = 1 // Machine is the interface representing the FSM type Machine interface { diff --git a/vendor/github.com/leodido/go-urn/urn.go b/vendor/github.com/leodido/go-urn/urn.go index 6415386..d51a6c9 100644 --- a/vendor/github.com/leodido/go-urn/urn.go +++ b/vendor/github.com/leodido/go-urn/urn.go @@ -83,4 +83,4 @@ func (u *URN) UnmarshalJSON(bytes []byte) error { *u = *value } return nil -} +} \ No newline at end of file diff --git a/vendor/github.com/magiconair/properties/decode.go b/vendor/github.com/magiconair/properties/decode.go index 4a5b717..3ebf804 100644 --- a/vendor/github.com/magiconair/properties/decode.go +++ b/vendor/github.com/magiconair/properties/decode.go @@ -281,11 +281,9 @@ func isTime(t reflect.Type) bool { return t == reflect.TypeOf(time.Time{}) } func isFloat(t reflect.Type) bool { return t.Kind() == reflect.Float32 || t.Kind() == reflect.Float64 } - func isInt(t reflect.Type) bool { return t.Kind() == reflect.Int || t.Kind() == reflect.Int8 || t.Kind() == reflect.Int16 || t.Kind() == reflect.Int32 || t.Kind() == reflect.Int64 } - func isUint(t reflect.Type) bool { return t.Kind() == reflect.Uint || t.Kind() == reflect.Uint8 || t.Kind() == reflect.Uint16 || t.Kind() == reflect.Uint32 || t.Kind() == reflect.Uint64 } diff --git a/vendor/github.com/magiconair/properties/properties.go b/vendor/github.com/magiconair/properties/properties.go index 4b5541b..0d0fc28 100644 --- a/vendor/github.com/magiconair/properties/properties.go +++ b/vendor/github.com/magiconair/properties/properties.go @@ -111,6 +111,7 @@ func (p *Properties) Get(key string) (value string, ok bool) { } expanded, err := p.expand(key, v) + // we guarantee that the expanded value is free of // circular references and malformed expressions // so we panic if we still get an error here. diff --git a/vendor/github.com/mitchellh/go-homedir/homedir.go b/vendor/github.com/mitchellh/go-homedir/homedir.go index cd419ba..2537853 100644 --- a/vendor/github.com/mitchellh/go-homedir/homedir.go +++ b/vendor/github.com/mitchellh/go-homedir/homedir.go @@ -16,10 +16,8 @@ import ( // by default. var DisableCache bool -var ( - homedirCache string - cacheLock sync.RWMutex -) +var homedirCache string +var cacheLock sync.RWMutex // Dir returns the home directory for the executing user. // diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go index 1f25ced..3643901 100644 --- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -1156,6 +1156,7 @@ func (d *Decoder) decodeArray(name string, data interface{}, val reflect.Value) if dataVal.Len() > arrayType.Len() { return fmt.Errorf( "'%s': expected source data to have length less or equal to %d, got %d", name, arrayType.Len(), dataVal.Len()) + } // Make a new array to hold our result, same size as the original data. diff --git a/vendor/github.com/modern-go/concurrent/log.go b/vendor/github.com/modern-go/concurrent/log.go index 4899eed..9756fcc 100644 --- a/vendor/github.com/modern-go/concurrent/log.go +++ b/vendor/github.com/modern-go/concurrent/log.go @@ -1,13 +1,13 @@ package concurrent import ( - "io/ioutil" - "log" "os" + "log" + "io/ioutil" ) // ErrorLogger is used to print out error, can be set to writer other than stderr var ErrorLogger = log.New(os.Stderr, "", 0) // InfoLogger is used to print informational message, default to off -var InfoLogger = log.New(ioutil.Discard, "", 0) +var InfoLogger = log.New(ioutil.Discard, "", 0) \ No newline at end of file diff --git a/vendor/github.com/modern-go/concurrent/unbounded_executor.go b/vendor/github.com/modern-go/concurrent/unbounded_executor.go index 5ea18eb..05a77dc 100644 --- a/vendor/github.com/modern-go/concurrent/unbounded_executor.go +++ b/vendor/github.com/modern-go/concurrent/unbounded_executor.go @@ -3,11 +3,11 @@ package concurrent import ( "context" "fmt" - "reflect" "runtime" "runtime/debug" "sync" "time" + "reflect" ) // HandlePanic logs goroutine panic by default diff --git a/vendor/github.com/modern-go/reflect2/reflect2.go b/vendor/github.com/modern-go/reflect2/reflect2.go index 86326b0..63b49c7 100644 --- a/vendor/github.com/modern-go/reflect2/reflect2.go +++ b/vendor/github.com/modern-go/reflect2/reflect2.go @@ -1,10 +1,9 @@ package reflect2 import ( + "github.com/modern-go/concurrent" "reflect" "unsafe" - - "github.com/modern-go/concurrent" ) type Type interface { @@ -126,10 +125,8 @@ type API interface { Type2(type1 reflect.Type) Type } -var ( - ConfigUnsafe = Config{UseSafeImplementation: false}.Froze() - ConfigSafe = Config{UseSafeImplementation: true}.Froze() -) +var ConfigUnsafe = Config{UseSafeImplementation: false}.Froze() +var ConfigSafe = Config{UseSafeImplementation: true}.Froze() type frozenConfig struct { useSafeImplementation bool @@ -139,7 +136,7 @@ type frozenConfig struct { func (cfg Config) Froze() *frozenConfig { return &frozenConfig{ useSafeImplementation: cfg.UseSafeImplementation, - cache: concurrent.NewMap(), + cache: concurrent.NewMap(), } } @@ -294,8 +291,8 @@ func UnsafeCastString(str string) []byte { stringHeader := (*reflect.StringHeader)(unsafe.Pointer(&str)) sliceHeader := &reflect.SliceHeader{ Data: stringHeader.Data, - Cap: stringHeader.Len, - Len: stringHeader.Len, + Cap: stringHeader.Len, + Len: stringHeader.Len, } return *(*[]byte)(unsafe.Pointer(sliceHeader)) } diff --git a/vendor/github.com/modern-go/reflect2/type_map.go b/vendor/github.com/modern-go/reflect2/type_map.go index dfe3c93..3acfb55 100644 --- a/vendor/github.com/modern-go/reflect2/type_map.go +++ b/vendor/github.com/modern-go/reflect2/type_map.go @@ -19,10 +19,8 @@ func typelinks2() (sections []unsafe.Pointer, offset [][]int32) // initOnce guards initialization of types and packages var initOnce sync.Once -var ( - types map[string]reflect.Type - packages map[string]map[string]reflect.Type -) +var types map[string]reflect.Type +var packages map[string]map[string]reflect.Type // discoverTypes initializes types and packages func discoverTypes() { diff --git a/vendor/github.com/pelletier/go-toml/marshal.go b/vendor/github.com/pelletier/go-toml/marshal.go index e1875b8..032e0ff 100644 --- a/vendor/github.com/pelletier/go-toml/marshal.go +++ b/vendor/github.com/pelletier/go-toml/marshal.go @@ -68,17 +68,15 @@ const ( OrderPreserve ) -var ( - timeType = reflect.TypeOf(time.Time{}) - marshalerType = reflect.TypeOf(new(Marshaler)).Elem() - unmarshalerType = reflect.TypeOf(new(Unmarshaler)).Elem() - textMarshalerType = reflect.TypeOf(new(encoding.TextMarshaler)).Elem() - textUnmarshalerType = reflect.TypeOf(new(encoding.TextUnmarshaler)).Elem() - localDateType = reflect.TypeOf(LocalDate{}) - localTimeType = reflect.TypeOf(LocalTime{}) - localDateTimeType = reflect.TypeOf(LocalDateTime{}) - mapStringInterfaceType = reflect.TypeOf(map[string]interface{}{}) -) +var timeType = reflect.TypeOf(time.Time{}) +var marshalerType = reflect.TypeOf(new(Marshaler)).Elem() +var unmarshalerType = reflect.TypeOf(new(Unmarshaler)).Elem() +var textMarshalerType = reflect.TypeOf(new(encoding.TextMarshaler)).Elem() +var textUnmarshalerType = reflect.TypeOf(new(encoding.TextUnmarshaler)).Elem() +var localDateType = reflect.TypeOf(LocalDate{}) +var localTimeType = reflect.TypeOf(LocalTime{}) +var localDateTimeType = reflect.TypeOf(LocalDateTime{}) +var mapStringInterfaceType = reflect.TypeOf(map[string]interface{}{}) // Check if the given marshal type maps to a Tree primitive func isPrimitive(mtype reflect.Type) bool { diff --git a/vendor/github.com/pelletier/go-toml/parser.go b/vendor/github.com/pelletier/go-toml/parser.go index 3dbd115..7bf40bb 100644 --- a/vendor/github.com/pelletier/go-toml/parser.go +++ b/vendor/github.com/pelletier/go-toml/parser.go @@ -231,10 +231,8 @@ func (p *tomlParser) parseAssign() tomlParserStateFn { return p.parseStart } -var ( - numberUnderscoreInvalidRegexp *regexp.Regexp - hexNumberUnderscoreInvalidRegexp *regexp.Regexp -) +var numberUnderscoreInvalidRegexp *regexp.Regexp +var hexNumberUnderscoreInvalidRegexp *regexp.Regexp func numberContainsInvalidUnderscore(value string) error { if numberUnderscoreInvalidRegexp.MatchString(value) { diff --git a/vendor/github.com/pelletier/go-toml/toml.go b/vendor/github.com/pelletier/go-toml/toml.go index 09d1b49..cbb89a9 100644 --- a/vendor/github.com/pelletier/go-toml/toml.go +++ b/vendor/github.com/pelletier/go-toml/toml.go @@ -364,13 +364,11 @@ func (t *Tree) SetPathWithOptions(keys []string, opts SetOptions, value interfac v.multiline = opts.Multiline toInsert = v default: - toInsert = &tomlValue{ - value: value, + toInsert = &tomlValue{value: value, comment: opts.Comment, commented: opts.Commented, multiline: opts.Multiline, - position: Position{Line: subtree.position.Line + len(subtree.values) + 1, Col: subtree.position.Col}, - } + position: Position{Line: subtree.position.Line + len(subtree.values) + 1, Col: subtree.position.Col}} } subtree.values[keys[len(keys)-1]] = toInsert diff --git a/vendor/github.com/rcrowley/go-metrics/debug.go b/vendor/github.com/rcrowley/go-metrics/debug.go index 24c0aca..043ccef 100644 --- a/vendor/github.com/rcrowley/go-metrics/debug.go +++ b/vendor/github.com/rcrowley/go-metrics/debug.go @@ -11,7 +11,7 @@ var ( LastGC Gauge NumGC Gauge Pause Histogram - // PauseQuantiles Histogram + //PauseQuantiles Histogram PauseTotal Gauge } ReadGCStats Timer @@ -22,7 +22,7 @@ var ( // Capture new values for the Go garbage collector statistics exported in // debug.GCStats. This is designed to be called as a goroutine. func CaptureDebugGCStats(r Registry, d time.Duration) { - for range time.Tick(d) { + for _ = range time.Tick(d) { CaptureDebugGCStatsOnce(r) } } @@ -46,7 +46,7 @@ func CaptureDebugGCStatsOnce(r Registry) { if lastGC != gcStats.LastGC && 0 < len(gcStats.Pause) { debugMetrics.GCStats.Pause.Update(int64(gcStats.Pause[0])) } - // debugMetrics.GCStats.PauseQuantiles.Update(gcStats.PauseQuantiles) + //debugMetrics.GCStats.PauseQuantiles.Update(gcStats.PauseQuantiles) debugMetrics.GCStats.PauseTotal.Update(int64(gcStats.PauseTotal)) } @@ -57,14 +57,14 @@ func RegisterDebugGCStats(r Registry) { debugMetrics.GCStats.LastGC = NewGauge() debugMetrics.GCStats.NumGC = NewGauge() debugMetrics.GCStats.Pause = NewHistogram(NewExpDecaySample(1028, 0.015)) - // debugMetrics.GCStats.PauseQuantiles = NewHistogram(NewExpDecaySample(1028, 0.015)) + //debugMetrics.GCStats.PauseQuantiles = NewHistogram(NewExpDecaySample(1028, 0.015)) debugMetrics.GCStats.PauseTotal = NewGauge() debugMetrics.ReadGCStats = NewTimer() r.Register("debug.GCStats.LastGC", debugMetrics.GCStats.LastGC) r.Register("debug.GCStats.NumGC", debugMetrics.GCStats.NumGC) r.Register("debug.GCStats.Pause", debugMetrics.GCStats.Pause) - // r.Register("debug.GCStats.PauseQuantiles", debugMetrics.GCStats.PauseQuantiles) + //r.Register("debug.GCStats.PauseQuantiles", debugMetrics.GCStats.PauseQuantiles) r.Register("debug.GCStats.PauseTotal", debugMetrics.GCStats.PauseTotal) r.Register("debug.ReadGCStats", debugMetrics.ReadGCStats) } diff --git a/vendor/github.com/rcrowley/go-metrics/graphite.go b/vendor/github.com/rcrowley/go-metrics/graphite.go index 142eec8..abd0a7d 100644 --- a/vendor/github.com/rcrowley/go-metrics/graphite.go +++ b/vendor/github.com/rcrowley/go-metrics/graphite.go @@ -39,7 +39,7 @@ func Graphite(r Registry, d time.Duration, prefix string, addr *net.TCPAddr) { // but it takes a GraphiteConfig instead. func GraphiteWithConfig(c GraphiteConfig) { log.Printf("WARNING: This go-metrics client has been DEPRECATED! It has been moved to https://github.com/cyberdelia/go-metrics-graphite and will be removed from rcrowley/go-metrics on August 12th 2015") - for range time.Tick(c.FlushInterval) { + for _ = range time.Tick(c.FlushInterval) { if err := graphite(&c); nil != err { log.Println(err) } diff --git a/vendor/github.com/rcrowley/go-metrics/json.go b/vendor/github.com/rcrowley/go-metrics/json.go index 2087d82..174b947 100644 --- a/vendor/github.com/rcrowley/go-metrics/json.go +++ b/vendor/github.com/rcrowley/go-metrics/json.go @@ -15,7 +15,7 @@ func (r *StandardRegistry) MarshalJSON() ([]byte, error) { // WriteJSON writes metrics from the given registry periodically to the // specified io.Writer as JSON. func WriteJSON(r Registry, d time.Duration, w io.Writer) { - for range time.Tick(d) { + for _ = range time.Tick(d) { WriteJSONOnce(r, w) } } diff --git a/vendor/github.com/rcrowley/go-metrics/log.go b/vendor/github.com/rcrowley/go-metrics/log.go index 0c8ea7c..f8074c0 100644 --- a/vendor/github.com/rcrowley/go-metrics/log.go +++ b/vendor/github.com/rcrowley/go-metrics/log.go @@ -18,7 +18,7 @@ func LogScaled(r Registry, freq time.Duration, scale time.Duration, l Logger) { du := float64(scale) duSuffix := scale.String()[1:] - for range time.Tick(freq) { + for _ = range time.Tick(freq) { r.Each(func(name string, i interface{}) { switch metric := i.(type) { case Counter: diff --git a/vendor/github.com/rcrowley/go-metrics/opentsdb.go b/vendor/github.com/rcrowley/go-metrics/opentsdb.go index df7f152..266b6c9 100644 --- a/vendor/github.com/rcrowley/go-metrics/opentsdb.go +++ b/vendor/github.com/rcrowley/go-metrics/opentsdb.go @@ -38,7 +38,7 @@ func OpenTSDB(r Registry, d time.Duration, prefix string, addr *net.TCPAddr) { // OpenTSDBWithConfig is a blocking exporter function just like OpenTSDB, // but it takes a OpenTSDBConfig instead. func OpenTSDBWithConfig(c OpenTSDBConfig) { - for range time.Tick(c.FlushInterval) { + for _ = range time.Tick(c.FlushInterval) { if err := openTSDB(&c); nil != err { log.Println(err) } diff --git a/vendor/github.com/rcrowley/go-metrics/registry.go b/vendor/github.com/rcrowley/go-metrics/registry.go index aeaf4a1..b3bab64 100644 --- a/vendor/github.com/rcrowley/go-metrics/registry.go +++ b/vendor/github.com/rcrowley/go-metrics/registry.go @@ -194,7 +194,7 @@ func (r *StandardRegistry) Unregister(name string) { func (r *StandardRegistry) UnregisterAll() { r.mutex.Lock() defer r.mutex.Unlock() - for name := range r.metrics { + for name, _ := range r.metrics { r.stop(name) delete(r.metrics, name) } diff --git a/vendor/github.com/rcrowley/go-metrics/runtime.go b/vendor/github.com/rcrowley/go-metrics/runtime.go index 9450c47..11c6b78 100644 --- a/vendor/github.com/rcrowley/go-metrics/runtime.go +++ b/vendor/github.com/rcrowley/go-metrics/runtime.go @@ -55,7 +55,7 @@ var ( // Capture new values for the Go runtime statistics exported in // runtime.MemStats. This is designed to be called as a goroutine. func CaptureRuntimeMemStats(r Registry, d time.Duration) { - for range time.Tick(d) { + for _ = range time.Tick(d) { CaptureRuntimeMemStatsOnce(r) } } diff --git a/vendor/github.com/rcrowley/go-metrics/syslog.go b/vendor/github.com/rcrowley/go-metrics/syslog.go index a0ed4b1..693f190 100644 --- a/vendor/github.com/rcrowley/go-metrics/syslog.go +++ b/vendor/github.com/rcrowley/go-metrics/syslog.go @@ -11,7 +11,7 @@ import ( // Output each metric in the given registry to syslog periodically using // the given syslogger. func Syslog(r Registry, d time.Duration, w *syslog.Writer) { - for range time.Tick(d) { + for _ = range time.Tick(d) { r.Each(func(name string, i interface{}) { switch metric := i.(type) { case Counter: diff --git a/vendor/github.com/rcrowley/go-metrics/writer.go b/vendor/github.com/rcrowley/go-metrics/writer.go index 88521a8..091e971 100644 --- a/vendor/github.com/rcrowley/go-metrics/writer.go +++ b/vendor/github.com/rcrowley/go-metrics/writer.go @@ -10,7 +10,7 @@ import ( // Write sorts writes each metric in the given registry periodically to the // given io.Writer. func Write(r Registry, d time.Duration, w io.Writer) { - for range time.Tick(d) { + for _ = range time.Tick(d) { WriteOnce(r, w) } } diff --git a/vendor/github.com/sirupsen/logrus/buffer_pool.go b/vendor/github.com/sirupsen/logrus/buffer_pool.go index cd4728a..4545dec 100644 --- a/vendor/github.com/sirupsen/logrus/buffer_pool.go +++ b/vendor/github.com/sirupsen/logrus/buffer_pool.go @@ -5,7 +5,9 @@ import ( "sync" ) -var bufferPool BufferPool +var ( + bufferPool BufferPool +) type BufferPool interface { Put(*bytes.Buffer) diff --git a/vendor/github.com/sirupsen/logrus/exported.go b/vendor/github.com/sirupsen/logrus/exported.go index 021443c..017c30c 100644 --- a/vendor/github.com/sirupsen/logrus/exported.go +++ b/vendor/github.com/sirupsen/logrus/exported.go @@ -6,8 +6,10 @@ import ( "time" ) -// std is the name of the standard logger in stdlib `log` -var std = New() +var ( + // std is the name of the standard logger in stdlib `log` + std = New() +) func StandardLogger() *Logger { return std diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go index 015fbdc..3377044 100644 --- a/vendor/github.com/sirupsen/logrus/logger.go +++ b/vendor/github.com/sirupsen/logrus/logger.go @@ -341,9 +341,9 @@ func (logger *Logger) Exit(code int) { logger.ExitFunc(code) } -// When file is opened with appending mode, it's safe to -// write concurrently to a file (within 4k message on Linux). -// In these cases user can choose to disable the lock. +//When file is opened with appending mode, it's safe to +//write concurrently to a file (within 4k message on Linux). +//In these cases user can choose to disable the lock. func (logger *Logger) SetNoLock() { logger.mu.Disable() } diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go index c2abb77..be2c6ef 100644 --- a/vendor/github.com/sirupsen/logrus/text_formatter.go +++ b/vendor/github.com/sirupsen/logrus/text_formatter.go @@ -202,6 +202,7 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { if f.isColored() { f.printColored(b, entry, keys, data, timestampFormat) } else { + for _, key := range fixedKeys { var value interface{} switch { diff --git a/vendor/github.com/spf13/afero/afero.go b/vendor/github.com/spf13/afero/afero.go index bf2644d..469ff7d 100644 --- a/vendor/github.com/spf13/afero/afero.go +++ b/vendor/github.com/spf13/afero/afero.go @@ -97,7 +97,7 @@ type Fs interface { // Chown changes the uid and gid of the named file. Chown(name string, uid, gid int) error - // Chtimes changes the access and modification times of the named file + //Chtimes changes the access and modification times of the named file Chtimes(name string, atime time.Time, mtime time.Time) error } diff --git a/vendor/github.com/spf13/afero/ioutil.go b/vendor/github.com/spf13/afero/ioutil.go index be0f05c..a403133 100644 --- a/vendor/github.com/spf13/afero/ioutil.go +++ b/vendor/github.com/spf13/afero/ioutil.go @@ -141,10 +141,8 @@ func WriteFile(fs Fs, filename string, data []byte, perm os.FileMode) error { // We generate random temporary file names so that there's a good // chance the file doesn't exist yet - keeps the number of tries in // TempFile to a minimum. -var ( - rand uint32 - randmu sync.Mutex -) +var rand uint32 +var randmu sync.Mutex func reseed() uint32 { return uint32(time.Now().UnixNano() + int64(os.Getpid())) @@ -216,7 +214,6 @@ func TempFile(fs Fs, dir, pattern string) (f File, err error) { func (a Afero) TempDir(dir, prefix string) (name string, err error) { return TempDir(a.Fs, dir, prefix) } - func TempDir(fs Fs, dir, prefix string) (name string, err error) { if dir == "" { dir = os.TempDir() diff --git a/vendor/github.com/spf13/afero/mem/file.go b/vendor/github.com/spf13/afero/mem/file.go index 1137e33..5a20730 100644 --- a/vendor/github.com/spf13/afero/mem/file.go +++ b/vendor/github.com/spf13/afero/mem/file.go @@ -303,19 +303,16 @@ func (s *FileInfo) Name() string { s.Unlock() return name } - func (s *FileInfo) Mode() os.FileMode { s.Lock() defer s.Unlock() return s.mode } - func (s *FileInfo) ModTime() time.Time { s.Lock() defer s.Unlock() return s.modtime } - func (s *FileInfo) IsDir() bool { s.Lock() defer s.Unlock() diff --git a/vendor/github.com/spf13/afero/memmap.go b/vendor/github.com/spf13/afero/memmap.go index d4fe7ac..5c265f9 100644 --- a/vendor/github.com/spf13/afero/memmap.go +++ b/vendor/github.com/spf13/afero/memmap.go @@ -96,12 +96,12 @@ func (m *MemMapFs) registerWithParent(f *mem.FileData, perm os.FileMode) { pdir := filepath.Dir(filepath.Clean(f.Name())) err := m.lockfreeMkdir(pdir, perm) if err != nil { - // log.Println("Mkdir error:", err) + //log.Println("Mkdir error:", err) return } parent, err = m.lockfreeOpen(pdir) if err != nil { - // log.Println("Open after Mkdir error:", err) + //log.Println("Open after Mkdir error:", err) return } } diff --git a/vendor/github.com/spf13/afero/unionFile.go b/vendor/github.com/spf13/afero/unionFile.go index 4b5a647..985363e 100644 --- a/vendor/github.com/spf13/afero/unionFile.go +++ b/vendor/github.com/spf13/afero/unionFile.go @@ -130,7 +130,7 @@ func (f *UnionFile) Name() string { type DirsMerger func(lofi, bofi []os.FileInfo) ([]os.FileInfo, error) var defaultUnionMergeDirsFn = func(lofi, bofi []os.FileInfo) ([]os.FileInfo, error) { - files := make(map[string]os.FileInfo) + var files = make(map[string]os.FileInfo) for _, fi := range lofi { files[fi.Name()] = fi @@ -151,6 +151,7 @@ var defaultUnionMergeDirsFn = func(lofi, bofi []os.FileInfo) ([]os.FileInfo, err } return rfi, nil + } // Readdir will weave the two directories together and diff --git a/vendor/github.com/spf13/afero/util.go b/vendor/github.com/spf13/afero/util.go index a333764..4f253f4 100644 --- a/vendor/github.com/spf13/afero/util.go +++ b/vendor/github.com/spf13/afero/util.go @@ -200,6 +200,7 @@ func FileContainsAnyBytes(fs Fs, filename string, subslices [][]byte) (bool, err // readerContains reports whether any of the subslices is within r. func readerContainsAny(r io.Reader, subslices ...[]byte) bool { + if r == nil || len(subslices) == 0 { return false } diff --git a/vendor/github.com/spf13/cast/caste.go b/vendor/github.com/spf13/cast/caste.go index a275778..70c7291 100644 --- a/vendor/github.com/spf13/cast/caste.go +++ b/vendor/github.com/spf13/cast/caste.go @@ -785,8 +785,8 @@ func indirectToStringerOrError(a interface{}) interface{} { return nil } - errorType := reflect.TypeOf((*error)(nil)).Elem() - fmtStringerType := reflect.TypeOf((*fmt.Stringer)(nil)).Elem() + var errorType = reflect.TypeOf((*error)(nil)).Elem() + var fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem() v := reflect.ValueOf(a) for !v.Type().Implements(fmtStringerType) && !v.Type().Implements(errorType) && v.Kind() == reflect.Ptr && !v.IsNil() { @@ -853,7 +853,7 @@ func ToStringE(i interface{}) (string, error) { // ToStringMapStringE casts an interface to a map[string]string type. func ToStringMapStringE(i interface{}) (map[string]string, error) { - m := map[string]string{} + var m = map[string]string{} switch v := i.(type) { case map[string]string: @@ -883,7 +883,7 @@ func ToStringMapStringE(i interface{}) (map[string]string, error) { // ToStringMapStringSliceE casts an interface to a map[string][]string type. func ToStringMapStringSliceE(i interface{}) (map[string][]string, error) { - m := map[string][]string{} + var m = map[string][]string{} switch v := i.(type) { case map[string][]string: @@ -947,7 +947,7 @@ func ToStringMapStringSliceE(i interface{}) (map[string][]string, error) { // ToStringMapBoolE casts an interface to a map[string]bool type. func ToStringMapBoolE(i interface{}) (map[string]bool, error) { - m := map[string]bool{} + var m = map[string]bool{} switch v := i.(type) { case map[interface{}]interface{}: @@ -972,7 +972,7 @@ func ToStringMapBoolE(i interface{}) (map[string]bool, error) { // ToStringMapE casts an interface to a map[string]interface{} type. func ToStringMapE(i interface{}) (map[string]interface{}, error) { - m := map[string]interface{}{} + var m = map[string]interface{}{} switch v := i.(type) { case map[interface{}]interface{}: @@ -992,7 +992,7 @@ func ToStringMapE(i interface{}) (map[string]interface{}, error) { // ToStringMapIntE casts an interface to a map[string]int{} type. func ToStringMapIntE(i interface{}) (map[string]int, error) { - m := map[string]int{} + var m = map[string]int{} if i == nil { return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int", i, i) } @@ -1033,7 +1033,7 @@ func ToStringMapIntE(i interface{}) (map[string]int, error) { // ToStringMapInt64E casts an interface to a map[string]int64{} type. func ToStringMapInt64E(i interface{}) (map[string]int64, error) { - m := map[string]int64{} + var m = map[string]int64{} if i == nil { return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int64", i, i) } diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go index 50a6883..846636d 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.go +++ b/vendor/github.com/spf13/cobra/bash_completions.go @@ -610,7 +610,6 @@ func writeCmdAliases(buf *bytes.Buffer, cmd *Command) { buf.WriteString(` fi`) buf.WriteString("\n") } - func writeArgAliases(buf *bytes.Buffer, cmd *Command) { buf.WriteString(" noun_aliases=()\n") sort.Sort(sort.StringSlice(cmd.ArgAliases)) diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go index 30c81a7..d01becc 100644 --- a/vendor/github.com/spf13/cobra/cobra.go +++ b/vendor/github.com/spf13/cobra/cobra.go @@ -192,6 +192,7 @@ func ld(s, t string, ignoreCase bool) int { d[i][j] = min + 1 } } + } return d[len(s)][len(t)] } diff --git a/vendor/github.com/spf13/pflag/bool_slice.go b/vendor/github.com/spf13/pflag/bool_slice.go index 06e0f50..3731370 100644 --- a/vendor/github.com/spf13/pflag/bool_slice.go +++ b/vendor/github.com/spf13/pflag/bool_slice.go @@ -22,6 +22,7 @@ func newBoolSliceValue(val []bool, p *[]bool) *boolSliceValue { // Set converts, and assigns, the comma-separated boolean argument string representation as the []bool value of this flag. // If Set is called on a flag that already has a []bool assigned, the newly converted values will be appended. func (s *boolSliceValue) Set(val string) error { + // remove all quote characters rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "") @@ -59,6 +60,7 @@ func (s *boolSliceValue) Type() string { // String defines a "native" format for this boolean slice flag value. func (s *boolSliceValue) String() string { + boolStrSlice := make([]string, len(*s.value)) for i, b := range *s.value { boolStrSlice[i] = strconv.FormatBool(b) diff --git a/vendor/github.com/spf13/pflag/bytes.go b/vendor/github.com/spf13/pflag/bytes.go index 6856088..67d5304 100644 --- a/vendor/github.com/spf13/pflag/bytes.go +++ b/vendor/github.com/spf13/pflag/bytes.go @@ -18,6 +18,7 @@ func (bytesHex bytesHexValue) String() string { // Set implements pflag.Value.Set. func (bytesHex *bytesHexValue) Set(value string) error { bin, err := hex.DecodeString(strings.TrimSpace(value)) + if err != nil { return err } @@ -38,6 +39,7 @@ func newBytesHexValue(val []byte, p *[]byte) *bytesHexValue { } func bytesHexConv(sval string) (interface{}, error) { + bin, err := hex.DecodeString(sval) if err == nil { @@ -50,6 +52,7 @@ func bytesHexConv(sval string) (interface{}, error) { // GetBytesHex return the []byte value of a flag with the given name func (f *FlagSet) GetBytesHex(name string) ([]byte, error) { val, err := f.getFlagType(name, "bytesHex", bytesHexConv) + if err != nil { return []byte{}, err } @@ -116,6 +119,7 @@ func (bytesBase64 bytesBase64Value) String() string { // Set implements pflag.Value.Set. func (bytesBase64 *bytesBase64Value) Set(value string) error { bin, err := base64.StdEncoding.DecodeString(strings.TrimSpace(value)) + if err != nil { return err } @@ -136,6 +140,7 @@ func newBytesBase64Value(val []byte, p *[]byte) *bytesBase64Value { } func bytesBase64ValueConv(sval string) (interface{}, error) { + bin, err := base64.StdEncoding.DecodeString(sval) if err == nil { return bin, nil @@ -147,6 +152,7 @@ func bytesBase64ValueConv(sval string) (interface{}, error) { // GetBytesBase64 return the []byte value of a flag with the given name func (f *FlagSet) GetBytesBase64(name string) ([]byte, error) { val, err := f.getFlagType(name, "bytesBase64", bytesBase64ValueConv) + if err != nil { return []byte{}, err } diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go index b24a6a5..24a5036 100644 --- a/vendor/github.com/spf13/pflag/flag.go +++ b/vendor/github.com/spf13/pflag/flag.go @@ -668,6 +668,7 @@ func wrap(i, w int, s string) string { } return r + } // FlagUsagesWrapped returns a string containing the usage information diff --git a/vendor/github.com/spf13/pflag/golangflag.go b/vendor/github.com/spf13/pflag/golangflag.go index 3e47328..d3dd72b 100644 --- a/vendor/github.com/spf13/pflag/golangflag.go +++ b/vendor/github.com/spf13/pflag/golangflag.go @@ -68,7 +68,7 @@ func PFlagFromGoFlag(goflag *goflag.Flag) *Flag { Usage: goflag.Usage, Value: wrapFlagValue(goflag.Value), // Looks like golang flags don't set DefValue correctly :-( - // DefValue: goflag.DefValue, + //DefValue: goflag.DefValue, DefValue: goflag.Value.String(), } // Ex: if the golang flag was -v, allow both -v and --v to work diff --git a/vendor/github.com/spf13/pflag/ip_slice.go b/vendor/github.com/spf13/pflag/ip_slice.go index 23bc991..775faae 100644 --- a/vendor/github.com/spf13/pflag/ip_slice.go +++ b/vendor/github.com/spf13/pflag/ip_slice.go @@ -23,6 +23,7 @@ func newIPSliceValue(val []net.IP, p *[]net.IP) *ipSliceValue { // Set converts, and assigns, the comma-separated IP argument string representation as the []net.IP value of this flag. // If Set is called on a flag that already has a []net.IP assigned, the newly converted values will be appended. func (s *ipSliceValue) Set(val string) error { + // remove all quote characters rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "") @@ -60,6 +61,7 @@ func (s *ipSliceValue) Type() string { // String defines a "native" format for this net.IP slice flag value. func (s *ipSliceValue) String() string { + ipStrSlice := make([]string, len(*s.value)) for i, ip := range *s.value { ipStrSlice[i] = ip.String() diff --git a/vendor/github.com/spf13/pflag/string.go b/vendor/github.com/spf13/pflag/string.go index c96b802..04e0a26 100644 --- a/vendor/github.com/spf13/pflag/string.go +++ b/vendor/github.com/spf13/pflag/string.go @@ -12,7 +12,6 @@ func (s *stringValue) Set(val string) error { *s = stringValue(val) return nil } - func (s *stringValue) Type() string { return "string" } diff --git a/vendor/github.com/spf13/viper/viper.go b/vendor/github.com/spf13/viper/viper.go index 5012684..405dc20 100644 --- a/vendor/github.com/spf13/viper/viper.go +++ b/vendor/github.com/spf13/viper/viper.go @@ -409,7 +409,6 @@ func (v *Viper) WatchConfig() { // SetConfigFile explicitly defines the path, name and extension of the config file. // Viper will use this and not check any of the config paths. func SetConfigFile(in string) { v.SetConfigFile(in) } - func (v *Viper) SetConfigFile(in string) { if in != "" { v.configFile = in @@ -420,7 +419,6 @@ func (v *Viper) SetConfigFile(in string) { // E.g. if your prefix is "spf", the env registry will look for env // variables that start with "SPF_". func SetEnvPrefix(in string) { v.SetEnvPrefix(in) } - func (v *Viper) SetEnvPrefix(in string) { if in != "" { v.envPrefix = in @@ -439,7 +437,6 @@ func (v *Viper) mergeWithEnvPrefix(in string) string { // but empty environment variables as valid values instead of falling back. // For backward compatibility reasons this is false by default. func AllowEmptyEnv(allowEmptyEnv bool) { v.AllowEmptyEnv(allowEmptyEnv) } - func (v *Viper) AllowEmptyEnv(allowEmptyEnv bool) { v.allowEmptyEnv = allowEmptyEnv } @@ -468,7 +465,6 @@ func (v *Viper) ConfigFileUsed() string { return v.configFile } // AddConfigPath adds a path for Viper to search for the config file in. // Can be called multiple times to define multiple search paths. func AddConfigPath(in string) { v.AddConfigPath(in) } - func (v *Viper) AddConfigPath(in string) { if in != "" { absin := absPathify(in) @@ -490,7 +486,6 @@ func (v *Viper) AddConfigPath(in string) { func AddRemoteProvider(provider, endpoint, path string) error { return v.AddRemoteProvider(provider, endpoint, path) } - func (v *Viper) AddRemoteProvider(provider, endpoint, path string) error { if !stringInSlice(provider, SupportedRemoteProviders) { return UnsupportedRemoteProviderError(provider) @@ -711,7 +706,6 @@ func (v *Viper) isPathShadowedInAutoEnv(path []string) string { // // "a b c" func SetTypeByDefaultValue(enable bool) { v.SetTypeByDefaultValue(enable) } - func (v *Viper) SetTypeByDefaultValue(enable bool) { v.typeByDefValue = enable } @@ -729,7 +723,6 @@ func GetViper() *Viper { // // Get returns an interface. For a specific value use one of the Get____ methods. func Get(key string) interface{} { return v.Get(key) } - func (v *Viper) Get(key string) interface{} { lcaseKey := strings.ToLower(key) val := v.find(lcaseKey, true) @@ -780,7 +773,6 @@ func (v *Viper) Get(key string) interface{} { // Sub returns new Viper instance representing a sub tree of this instance. // Sub is case-insensitive for a key. func Sub(key string) *Viper { return v.Sub(key) } - func (v *Viper) Sub(key string) *Viper { subv := New() data := v.Get(key) @@ -797,112 +789,96 @@ func (v *Viper) Sub(key string) *Viper { // GetString returns the value associated with the key as a string. func GetString(key string) string { return v.GetString(key) } - func (v *Viper) GetString(key string) string { return cast.ToString(v.Get(key)) } // GetBool returns the value associated with the key as a boolean. func GetBool(key string) bool { return v.GetBool(key) } - func (v *Viper) GetBool(key string) bool { return cast.ToBool(v.Get(key)) } // GetInt returns the value associated with the key as an integer. func GetInt(key string) int { return v.GetInt(key) } - func (v *Viper) GetInt(key string) int { return cast.ToInt(v.Get(key)) } // GetInt32 returns the value associated with the key as an integer. func GetInt32(key string) int32 { return v.GetInt32(key) } - func (v *Viper) GetInt32(key string) int32 { return cast.ToInt32(v.Get(key)) } // GetInt64 returns the value associated with the key as an integer. func GetInt64(key string) int64 { return v.GetInt64(key) } - func (v *Viper) GetInt64(key string) int64 { return cast.ToInt64(v.Get(key)) } // GetUint returns the value associated with the key as an unsigned integer. func GetUint(key string) uint { return v.GetUint(key) } - func (v *Viper) GetUint(key string) uint { return cast.ToUint(v.Get(key)) } // GetUint32 returns the value associated with the key as an unsigned integer. func GetUint32(key string) uint32 { return v.GetUint32(key) } - func (v *Viper) GetUint32(key string) uint32 { return cast.ToUint32(v.Get(key)) } // GetUint64 returns the value associated with the key as an unsigned integer. func GetUint64(key string) uint64 { return v.GetUint64(key) } - func (v *Viper) GetUint64(key string) uint64 { return cast.ToUint64(v.Get(key)) } // GetFloat64 returns the value associated with the key as a float64. func GetFloat64(key string) float64 { return v.GetFloat64(key) } - func (v *Viper) GetFloat64(key string) float64 { return cast.ToFloat64(v.Get(key)) } // GetTime returns the value associated with the key as time. func GetTime(key string) time.Time { return v.GetTime(key) } - func (v *Viper) GetTime(key string) time.Time { return cast.ToTime(v.Get(key)) } // GetDuration returns the value associated with the key as a duration. func GetDuration(key string) time.Duration { return v.GetDuration(key) } - func (v *Viper) GetDuration(key string) time.Duration { return cast.ToDuration(v.Get(key)) } // GetIntSlice returns the value associated with the key as a slice of int values. func GetIntSlice(key string) []int { return v.GetIntSlice(key) } - func (v *Viper) GetIntSlice(key string) []int { return cast.ToIntSlice(v.Get(key)) } // GetStringSlice returns the value associated with the key as a slice of strings. func GetStringSlice(key string) []string { return v.GetStringSlice(key) } - func (v *Viper) GetStringSlice(key string) []string { return cast.ToStringSlice(v.Get(key)) } // GetStringMap returns the value associated with the key as a map of interfaces. func GetStringMap(key string) map[string]interface{} { return v.GetStringMap(key) } - func (v *Viper) GetStringMap(key string) map[string]interface{} { return cast.ToStringMap(v.Get(key)) } // GetStringMapString returns the value associated with the key as a map of strings. func GetStringMapString(key string) map[string]string { return v.GetStringMapString(key) } - func (v *Viper) GetStringMapString(key string) map[string]string { return cast.ToStringMapString(v.Get(key)) } // GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings. func GetStringMapStringSlice(key string) map[string][]string { return v.GetStringMapStringSlice(key) } - func (v *Viper) GetStringMapStringSlice(key string) map[string][]string { return cast.ToStringMapStringSlice(v.Get(key)) } @@ -910,7 +886,6 @@ func (v *Viper) GetStringMapStringSlice(key string) map[string][]string { // GetSizeInBytes returns the size of the value associated with the given key // in bytes. func GetSizeInBytes(key string) uint { return v.GetSizeInBytes(key) } - func (v *Viper) GetSizeInBytes(key string) uint { sizeStr := cast.ToString(v.Get(key)) return parseSizeInBytes(sizeStr) @@ -920,7 +895,6 @@ func (v *Viper) GetSizeInBytes(key string) uint { func UnmarshalKey(key string, rawVal interface{}, opts ...DecoderConfigOption) error { return v.UnmarshalKey(key, rawVal, opts...) } - func (v *Viper) UnmarshalKey(key string, rawVal interface{}, opts ...DecoderConfigOption) error { return decode(v.Get(key), defaultDecoderConfig(rawVal, opts...)) } @@ -930,7 +904,6 @@ func (v *Viper) UnmarshalKey(key string, rawVal interface{}, opts ...DecoderConf func Unmarshal(rawVal interface{}, opts ...DecoderConfigOption) error { return v.Unmarshal(rawVal, opts...) } - func (v *Viper) Unmarshal(rawVal interface{}, opts ...DecoderConfigOption) error { return decode(v.AllSettings(), defaultDecoderConfig(rawVal, opts...)) } @@ -967,7 +940,6 @@ func decode(input interface{}, config *mapstructure.DecoderConfig) error { func UnmarshalExact(rawVal interface{}, opts ...DecoderConfigOption) error { return v.UnmarshalExact(rawVal, opts...) } - func (v *Viper) UnmarshalExact(rawVal interface{}, opts ...DecoderConfigOption) error { config := defaultDecoderConfig(rawVal, opts...) config.ErrorUnused = true @@ -978,7 +950,6 @@ func (v *Viper) UnmarshalExact(rawVal interface{}, opts ...DecoderConfigOption) // BindPFlags binds a full flag set to the configuration, using each flag's long // name as the config key. func BindPFlags(flags *pflag.FlagSet) error { return v.BindPFlags(flags) } - func (v *Viper) BindPFlags(flags *pflag.FlagSet) error { return v.BindFlagValues(pflagValueSet{flags}) } @@ -990,7 +961,6 @@ func (v *Viper) BindPFlags(flags *pflag.FlagSet) error { // Viper.BindPFlag("port", serverCmd.Flags().Lookup("port")) // func BindPFlag(key string, flag *pflag.Flag) error { return v.BindPFlag(key, flag) } - func (v *Viper) BindPFlag(key string, flag *pflag.Flag) error { return v.BindFlagValue(key, pflagValue{flag}) } @@ -998,7 +968,6 @@ func (v *Viper) BindPFlag(key string, flag *pflag.Flag) error { // BindFlagValues binds a full FlagValue set to the configuration, using each flag's long // name as the config key. func BindFlagValues(flags FlagValueSet) error { return v.BindFlagValues(flags) } - func (v *Viper) BindFlagValues(flags FlagValueSet) (err error) { flags.VisitAll(func(flag FlagValue) { if err = v.BindFlagValue(flag.Name(), flag); err != nil { @@ -1010,7 +979,6 @@ func (v *Viper) BindFlagValues(flags FlagValueSet) (err error) { // BindFlagValue binds a specific key to a FlagValue. func BindFlagValue(key string, flag FlagValue) error { return v.BindFlagValue(key, flag) } - func (v *Viper) BindFlagValue(key string, flag FlagValue) error { if flag == nil { return fmt.Errorf("flag for %q is nil", key) @@ -1024,7 +992,6 @@ func (v *Viper) BindFlagValue(key string, flag FlagValue) error { // If only a key is provided, it will use the env key matching the key, uppercased. // EnvPrefix will be used when set when env name is not provided. func BindEnv(input ...string) error { return v.BindEnv(input...) } - func (v *Viper) BindEnv(input ...string) error { var key, envkey string if len(input) == 0 { @@ -1223,7 +1190,6 @@ func stringToStringConv(val string) interface{} { // IsSet checks to see if the key has been set in any of the data locations. // IsSet is case-insensitive for a key. func IsSet(key string) bool { return v.IsSet(key) } - func (v *Viper) IsSet(key string) bool { lcaseKey := strings.ToLower(key) val := v.find(lcaseKey, false) @@ -1233,7 +1199,6 @@ func (v *Viper) IsSet(key string) bool { // AutomaticEnv has Viper check ENV variables for all. // keys set in config, default & flags func AutomaticEnv() { v.AutomaticEnv() } - func (v *Viper) AutomaticEnv() { v.automaticEnvApplied = true } @@ -1242,7 +1207,6 @@ func (v *Viper) AutomaticEnv() { // Useful for mapping an environmental variable to a key that does // not match it. func SetEnvKeyReplacer(r *strings.Replacer) { v.SetEnvKeyReplacer(r) } - func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) { v.envKeyReplacer = r } @@ -1250,7 +1214,6 @@ func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) { // RegisterAlias creates an alias that provides another accessor for the same key. // This enables one to change a name without breaking the application. func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) } - func (v *Viper) RegisterAlias(alias string, key string) { v.registerAlias(alias, strings.ToLower(key)) } @@ -1298,7 +1261,6 @@ func (v *Viper) realKey(key string) string { // InConfig checks to see if the given key (or an alias) is in the config file. func InConfig(key string) bool { return v.InConfig(key) } - func (v *Viper) InConfig(key string) bool { // if the requested key is an alias, then return the proper key key = v.realKey(key) @@ -1311,7 +1273,6 @@ func (v *Viper) InConfig(key string) bool { // SetDefault is case-insensitive for a key. // Default only used when no value is provided by the user via flag, config or ENV. func SetDefault(key string, value interface{}) { v.SetDefault(key, value) } - func (v *Viper) SetDefault(key string, value interface{}) { // If alias passed in, then set the proper default key = v.realKey(strings.ToLower(key)) @@ -1330,7 +1291,6 @@ func (v *Viper) SetDefault(key string, value interface{}) { // Will be used instead of values obtained via // flags, config file, ENV, default, or key/value store. func Set(key string, value interface{}) { v.Set(key, value) } - func (v *Viper) Set(key string, value interface{}) { // If alias passed in, then set the proper override key = v.realKey(strings.ToLower(key)) @@ -1347,7 +1307,6 @@ func (v *Viper) Set(key string, value interface{}) { // ReadInConfig will discover and load the configuration file from disk // and key/value stores, searching in one of the defined paths. func ReadInConfig() error { return v.ReadInConfig() } - func (v *Viper) ReadInConfig() error { jww.INFO.Println("Attempting to read in config file") filename, err := v.getConfigFile() @@ -1378,7 +1337,6 @@ func (v *Viper) ReadInConfig() error { // MergeInConfig merges a new configuration with an existing config. func MergeInConfig() error { return v.MergeInConfig() } - func (v *Viper) MergeInConfig() error { jww.INFO.Println("Attempting to merge in config file") filename, err := v.getConfigFile() @@ -1401,7 +1359,6 @@ func (v *Viper) MergeInConfig() error { // ReadConfig will read a configuration file, setting existing keys to nil if the // key does not exist in the file. func ReadConfig(in io.Reader) error { return v.ReadConfig(in) } - func (v *Viper) ReadConfig(in io.Reader) error { v.config = make(map[string]interface{}) return v.unmarshalReader(in, v.config) @@ -1409,7 +1366,6 @@ func (v *Viper) ReadConfig(in io.Reader) error { // MergeConfig merges a new configuration with an existing config. func MergeConfig(in io.Reader) error { return v.MergeConfig(in) } - func (v *Viper) MergeConfig(in io.Reader) error { cfg := make(map[string]interface{}) if err := v.unmarshalReader(in, cfg); err != nil { @@ -1421,7 +1377,6 @@ func (v *Viper) MergeConfig(in io.Reader) error { // MergeConfigMap merges the configuration from the map given with an existing config. // Note that the map given may be modified. func MergeConfigMap(cfg map[string]interface{}) error { return v.MergeConfigMap(cfg) } - func (v *Viper) MergeConfigMap(cfg map[string]interface{}) error { if v.config == nil { v.config = make(map[string]interface{}) @@ -1433,7 +1388,6 @@ func (v *Viper) MergeConfigMap(cfg map[string]interface{}) error { // WriteConfig writes the current configuration to a file. func WriteConfig() error { return v.WriteConfig() } - func (v *Viper) WriteConfig() error { filename, err := v.getConfigFile() if err != nil { @@ -1444,7 +1398,6 @@ func (v *Viper) WriteConfig() error { // SafeWriteConfig writes current configuration to file only if the file does not exist. func SafeWriteConfig() error { return v.SafeWriteConfig() } - func (v *Viper) SafeWriteConfig() error { if len(v.configPaths) < 1 { return errors.New("missing configuration for 'configPath'") @@ -1454,14 +1407,12 @@ func (v *Viper) SafeWriteConfig() error { // WriteConfigAs writes current configuration to a given filename. func WriteConfigAs(filename string) error { return v.WriteConfigAs(filename) } - func (v *Viper) WriteConfigAs(filename string) error { return v.writeConfig(filename, true) } // SafeWriteConfigAs writes current configuration to a given filename if it does not exist. func SafeWriteConfigAs(filename string) error { return v.SafeWriteConfigAs(filename) } - func (v *Viper) SafeWriteConfigAs(filename string) error { alreadyExists, err := afero.Exists(v.fs, filename) if alreadyExists && err == nil { @@ -1512,7 +1463,6 @@ func (v *Viper) writeConfig(filename string, force bool) error { func unmarshalReader(in io.Reader, c map[string]interface{}) error { return v.unmarshalReader(in, c) } - func (v *Viper) unmarshalReader(in io.Reader, c map[string]interface{}) error { buf := new(bytes.Buffer) buf.ReadFrom(in) @@ -1787,7 +1737,6 @@ func mergeMaps( // ReadRemoteConfig attempts to get configuration from a remote source // and read it in the remote configuration registry. func ReadRemoteConfig() error { return v.ReadRemoteConfig() } - func (v *Viper) ReadRemoteConfig() error { return v.getKeyValueConfig() } @@ -1869,7 +1818,6 @@ func (v *Viper) watchRemoteConfig(provider RemoteProvider) (map[string]interface // AllKeys returns all keys holding a value, regardless of where they are set. // Nested keys are returned with a v.keyDelim separator func AllKeys() []string { return v.AllKeys() } - func (v *Viper) AllKeys() []string { m := map[string]bool{} // add all paths, by order of descending priority to ensure correct shadowing @@ -1950,7 +1898,6 @@ outer: // AllSettings merges all settings and returns them as a map[string]interface{}. func AllSettings() map[string]interface{} { return v.AllSettings() } - func (v *Viper) AllSettings() map[string]interface{} { m := map[string]interface{}{} // start from the list of keys, and construct the map one value at a time @@ -1972,7 +1919,6 @@ func (v *Viper) AllSettings() map[string]interface{} { // SetFs sets the filesystem to use to read configuration. func SetFs(fs afero.Fs) { v.SetFs(fs) } - func (v *Viper) SetFs(fs afero.Fs) { v.fs = fs } @@ -1980,7 +1926,6 @@ func (v *Viper) SetFs(fs afero.Fs) { // SetConfigName sets name for the config file. // Does not include extension. func SetConfigName(in string) { v.SetConfigName(in) } - func (v *Viper) SetConfigName(in string) { if in != "" { v.configName = in @@ -1991,7 +1936,6 @@ func (v *Viper) SetConfigName(in string) { // SetConfigType sets the type of the configuration returned by the // remote source, e.g. "json". func SetConfigType(in string) { v.SetConfigType(in) } - func (v *Viper) SetConfigType(in string) { if in != "" { v.configType = in @@ -2000,7 +1944,6 @@ func (v *Viper) SetConfigType(in string) { // SetConfigPermissions sets the permissions for the config file. func SetConfigPermissions(perm os.FileMode) { v.SetConfigPermissions(perm) } - func (v *Viper) SetConfigPermissions(perm os.FileMode) { v.configPermissions = perm.Perm() } @@ -2071,7 +2014,6 @@ func (v *Viper) findConfigFile() (string, error) { // Debug prints all configuration registries for debugging // purposes. func Debug() { v.Debug() } - func (v *Viper) Debug() { fmt.Printf("Aliases:\n%#v\n", v.aliases) fmt.Printf("Override:\n%#v\n", v.override) diff --git a/vendor/github.com/ugorji/go/codec/binc.go b/vendor/github.com/ugorji/go/codec/binc.go index 787d4fc..d2b4ba0 100644 --- a/vendor/github.com/ugorji/go/codec/binc.go +++ b/vendor/github.com/ugorji/go/codec/binc.go @@ -715,7 +715,7 @@ func (d *bincDecDriver) DecodeStringAsBytes() (bs2 []byte) { if d.advanceNil() { return } - slen := -1 + var slen = -1 switch d.vd { case bincVdString, bincVdByteArray: slen = d.decLen() @@ -943,8 +943,8 @@ func (d *bincDecDriver) nextValueBytes(v0 []byte) (v []byte) { d.readNextBd() } v = v0 - h := decNextValueBytesHelper{d: &d.d} - cursor := d.d.rb.c - 1 + var h = decNextValueBytesHelper{d: &d.d} + var cursor = d.d.rb.c - 1 h.append1(&v, d.bd) v = d.nextValueBytesBdReadR(v) d.bdRead = false @@ -955,14 +955,14 @@ func (d *bincDecDriver) nextValueBytes(v0 []byte) (v []byte) { func (d *bincDecDriver) nextValueBytesR(v0 []byte) (v []byte) { d.readNextBd() v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} h.append1(&v, d.bd) return d.nextValueBytesBdReadR(v) } func (d *bincDecDriver) nextValueBytesBdReadR(v0 []byte) (v []byte) { v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} fnLen := func(vs byte) uint { switch vs { @@ -1105,7 +1105,7 @@ func (h *BincHandle) Name() string { return "binc" } func (h *BincHandle) desc(bd byte) string { return bincdesc(bd>>4, bd&0x0f) } func (h *BincHandle) newEncDriver() encDriver { - e := &bincEncDriver{h: h} + var e = &bincEncDriver{h: h} e.e.e = e e.e.init(h) e.reset() @@ -1284,9 +1284,9 @@ func bincDecodeTime(bs []byte) (tt time.Time, err error) { tz = bigen.Uint16([2]byte{bs[i], bs[i+1]}) // sign extend sign bit into top 2 MSB (which were dst bits): if tz&(1<<13) == 0 { // positive - tz = tz & 0x3fff // clear 2 MSBs: dst bits + tz = tz & 0x3fff //clear 2 MSBs: dst bits } else { // negative - tz = tz | 0xc000 // set 2 MSBs: dst bits + tz = tz | 0xc000 //set 2 MSBs: dst bits } tzint := int16(tz) if tzint == 0 { @@ -1301,7 +1301,5 @@ func bincDecodeTime(bs []byte) (tt time.Time, err error) { return } -var ( - _ decDriver = (*bincDecDriver)(nil) - _ encDriver = (*bincEncDriver)(nil) -) +var _ decDriver = (*bincDecDriver)(nil) +var _ encDriver = (*bincEncDriver)(nil) diff --git a/vendor/github.com/ugorji/go/codec/cbor.go b/vendor/github.com/ugorji/go/codec/cbor.go index 205aa2e..b18e5af 100644 --- a/vendor/github.com/ugorji/go/codec/cbor.go +++ b/vendor/github.com/ugorji/go/codec/cbor.go @@ -785,8 +785,8 @@ func (d *cborDecDriver) nextValueBytes(v0 []byte) (v []byte) { d.readNextBd() } v = v0 - h := decNextValueBytesHelper{d: &d.d} - cursor := d.d.rb.c - 1 + var h = decNextValueBytesHelper{d: &d.d} + var cursor = d.d.rb.c - 1 h.append1(&v, d.bd) v = d.nextValueBytesBdReadR(v) d.bdRead = false @@ -797,14 +797,14 @@ func (d *cborDecDriver) nextValueBytes(v0 []byte) (v []byte) { func (d *cborDecDriver) nextValueBytesR(v0 []byte) (v []byte) { d.readNextBd() v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} h.append1(&v, d.bd) return d.nextValueBytesBdReadR(v) } func (d *cborDecDriver) nextValueBytesBdReadR(v0 []byte) (v []byte) { v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} var bs []byte var ui uint64 @@ -930,7 +930,7 @@ func (h *CborHandle) Name() string { return "cbor" } func (h *CborHandle) desc(bd byte) string { return cbordesc(bd) } func (h *CborHandle) newEncDriver() encDriver { - e := &cborEncDriver{h: h} + var e = &cborEncDriver{h: h} e.e.e = e e.e.init(h) e.reset() @@ -955,7 +955,5 @@ func (d *cborDecDriver) reset() { d.st = d.h.SkipUnexpectedTags } -var ( - _ decDriver = (*cborDecDriver)(nil) - _ encDriver = (*cborEncDriver)(nil) -) +var _ decDriver = (*cborDecDriver)(nil) +var _ encDriver = (*cborEncDriver)(nil) diff --git a/vendor/github.com/ugorji/go/codec/decimal.go b/vendor/github.com/ugorji/go/codec/decimal.go index d51d6a5..a6c762e 100644 --- a/vendor/github.com/ugorji/go/codec/decimal.go +++ b/vendor/github.com/ugorji/go/codec/decimal.go @@ -98,13 +98,11 @@ var uint64pow10 = [...]uint64{ 1 * quadrillion, 10 * quadrillion, 100 * quadrillion, 1 * quintillion, 10 * quintillion, } - var float64pow10 = [...]float64{ 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22, } - var float32pow10 = [...]float32{ 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, } @@ -127,15 +125,11 @@ type floatinfo struct { mantCutoff uint64 } -var ( - fi32 = floatinfo{23, true, 10, 7, false, 1<<23 - 1} - fi64 = floatinfo{52, false, 22, 15, false, 1<<52 - 1} -) +var fi32 = floatinfo{23, true, 10, 7, false, 1<<23 - 1} +var fi64 = floatinfo{52, false, 22, 15, false, 1<<52 - 1} -var ( - fi64u = floatinfo{0, false, 19, 0, true, fUint64Cutoff} - fi64i = floatinfo{0, false, 19, 0, true, fUint64Cutoff} -) +var fi64u = floatinfo{0, false, 19, 0, true, fUint64Cutoff} +var fi64i = floatinfo{0, false, 19, 0, true, fUint64Cutoff} func strconvParseErr(b []byte, fn string) error { return &strconv.NumError{ @@ -335,7 +329,7 @@ type readFloatResult struct { func readFloat(s []byte, y floatinfo) (r readFloatResult) { var i uint // uint, so that we eliminate bounds checking - slen := uint(len(s)) + var slen = uint(len(s)) if slen == 0 { // read an empty string as the zero value // r.bad = true diff --git a/vendor/github.com/ugorji/go/codec/decode.go b/vendor/github.com/ugorji/go/codec/decode.go index 21c5b43..c0f60f4 100644 --- a/vendor/github.com/ugorji/go/codec/decode.go +++ b/vendor/github.com/ugorji/go/codec/decode.go @@ -345,7 +345,7 @@ func (d *Decoder) jsonUnmarshal(f *codecFnInfo, rv reflect.Value) { func (d *Decoder) jsonUnmarshalV(tm jsonUnmarshaler) { // grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself. - bs0 := []byte{} + var bs0 = []byte{} if !d.bytes { bs0 = d.blist.get(256) } @@ -502,7 +502,7 @@ func (d *Decoder) kInterfaceNaked(f *codecFnInfo) (rvn reflect.Value) { case valueTypeExt: tag, bytes := n.u, n.l // calling decode below might taint the values bfn := d.h.getExtForTag(tag) - re := RawExt{Tag: tag} + var re = RawExt{Tag: tag} if bytes == nil { // it is one of the InterfaceExt ones: json and cbor. // most likely cbor, as json decoding never reveals valueTypeExt (no tagging support) @@ -767,7 +767,7 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) { var rvChanged bool - rv0 := rv + var rv0 = rv var rv9 reflect.Value rvlen := rvLenSlice(rv) @@ -806,7 +806,7 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) { } // consider creating new element once, and just decoding into it. - elemReset := d.h.SliceElementReset + var elemReset = d.h.SliceElementReset var j int @@ -941,7 +941,7 @@ func (d *Decoder) kArray(f *codecFnInfo, rv reflect.Value) { } // consider creating new element once, and just decoding into it. - elemReset := d.h.SliceElementReset + var elemReset = d.h.SliceElementReset for j := 0; d.containerNext(j, containerLenS, hasLen); j++ { // note that you cannot expand the array if indefinite and we go past array length @@ -989,7 +989,7 @@ func (d *Decoder) kChan(f *codecFnInfo, rv reflect.Value) { return } - rvCanset := rv.CanSet() + var rvCanset = rv.CanSet() // only expects valueType(Array|Map - nil handled above) slh, containerLenS := d.decSliceHelperStart() @@ -1014,7 +1014,7 @@ func (d *Decoder) kChan(f *codecFnInfo, rv reflect.Value) { var fn *codecFn var rvChanged bool - rv0 := rv + var rv0 = rv var rv9 reflect.Value var rvlen int // := rv.Len() @@ -1051,6 +1051,7 @@ func (d *Decoder) kChan(f *codecFnInfo, rv reflect.Value) { if rvChanged { // infers rvCanset=true, so it can be reset rv0.Set(rv) } + } func (d *Decoder) kMap(f *codecFnInfo, rv reflect.Value) { @@ -1077,7 +1078,7 @@ func (d *Decoder) kMap(f *codecFnInfo, rv reflect.Value) { var vtypeElem reflect.Type var keyFn, valFn *codecFn - ktypeLo, vtypeLo := ktype, vtype + var ktypeLo, vtypeLo = ktype, vtype if ktypeKind == reflect.Ptr { for ktypeLo = ktype.Elem(); ktypeLo.Kind() == reflect.Ptr; ktypeLo = ktypeLo.Elem() { diff --git a/vendor/github.com/ugorji/go/codec/doc.go b/vendor/github.com/ugorji/go/codec/doc.go index 507ad6e..e53f7ff 100644 --- a/vendor/github.com/ugorji/go/codec/doc.go +++ b/vendor/github.com/ugorji/go/codec/doc.go @@ -207,7 +207,7 @@ Running Benchmarks cd bench go test -bench . -benchmem -benchtime 1s - + Please see http://github.com/ugorji/go-codec-bench . Caveats diff --git a/vendor/github.com/ugorji/go/codec/encode.go b/vendor/github.com/ugorji/go/codec/encode.go index c74727c..26cf4a6 100644 --- a/vendor/github.com/ugorji/go/codec/encode.go +++ b/vendor/github.com/ugorji/go/codec/encode.go @@ -310,7 +310,7 @@ func (e *Encoder) kSeqFn(rtelem reflect.Type) (fn *codecFn) { } func (e *Encoder) kSliceWMbs(rv reflect.Value, ti *typeInfo) { - l := rvLenSlice(rv) + var l = rvLenSlice(rv) if l == 0 { e.mapStart(0) } else { @@ -330,7 +330,7 @@ func (e *Encoder) kSliceWMbs(rv reflect.Value, ti *typeInfo) { } func (e *Encoder) kSliceW(rv reflect.Value, ti *typeInfo) { - l := rvLenSlice(rv) + var l = rvLenSlice(rv) e.arrayStart(l) if l > 0 { fn := e.kSeqFn(ti.elem) @@ -343,7 +343,7 @@ func (e *Encoder) kSliceW(rv reflect.Value, ti *typeInfo) { } func (e *Encoder) kArrayWMbs(rv reflect.Value, ti *typeInfo) { - l := rv.Len() + var l = rv.Len() if l == 0 { e.mapStart(0) } else { @@ -363,7 +363,7 @@ func (e *Encoder) kArrayWMbs(rv reflect.Value, ti *typeInfo) { } func (e *Encoder) kArrayW(rv reflect.Value, ti *typeInfo) { - l := rv.Len() + var l = rv.Len() e.arrayStart(l) if l > 0 { fn := e.kSeqFn(ti.elem) @@ -520,7 +520,7 @@ func (e *Encoder) kStruct(f *codecFnInfo, rv reflect.Value) { } newlen += len(f.ti.sfiSrc) - fkvs := e.slist.get(newlen)[:newlen] + var fkvs = e.slist.get(newlen)[:newlen] recur := e.h.RecursiveEmptyCheck @@ -575,7 +575,7 @@ func (e *Encoder) kStruct(f *codecFnInfo, rv reflect.Value) { if si.path.omitEmpty && isEmptyValue(kv.r, e.h.TypeInfos, recur) { switch kv.r.Kind() { case reflect.Struct, reflect.Interface, reflect.Ptr, reflect.Array, reflect.Map, reflect.Slice: - kv.r = reflect.Value{} // encode as nil + kv.r = reflect.Value{} //encode as nil } } fkvs[i] = kv @@ -626,7 +626,7 @@ func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) { valFn = e.h.fn(rtval) } - rvv := mapAddrLoopvarRV(f.ti.elem, vtypeKind) + var rvv = mapAddrLoopvarRV(f.ti.elem, vtypeKind) if e.h.Canonical { e.kMapCanonical(f.ti, rv, rvv, valFn) @@ -635,7 +635,7 @@ func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) { } rtkey := f.ti.key - keyTypeIsString := stringTypId == rt2id(rtkey) // rtkeyid + var keyTypeIsString = stringTypId == rt2id(rtkey) // rtkeyid if !keyTypeIsString { for rtkey.Kind() == reflect.Ptr { rtkey = rtkey.Elem() @@ -645,7 +645,7 @@ func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) { } } - rvk := mapAddrLoopvarRV(f.ti.key, ktypeKind) + var rvk = mapAddrLoopvarRV(f.ti.key, ktypeKind) var it mapIter mapRange(&it, rv, rvk, rvv, true) diff --git a/vendor/github.com/ugorji/go/codec/fast-path.generated.go b/vendor/github.com/ugorji/go/codec/fast-path.generated.go index e346df6..db1e738 100644 --- a/vendor/github.com/ugorji/go/codec/fast-path.generated.go +++ b/vendor/github.com/ugorji/go/codec/fast-path.generated.go @@ -48,15 +48,11 @@ type fastpathE struct { decfn func(*Decoder, *codecFnInfo, reflect.Value) } -type ( - fastpathA [56]fastpathE - fastpathARtid [56]uintptr -) +type fastpathA [56]fastpathE +type fastpathARtid [56]uintptr -var ( - fastpathAv fastpathA - fastpathAvRtid fastpathARtid -) +var fastpathAv fastpathA +var fastpathAvRtid fastpathARtid type fastpathAslice struct{} @@ -64,7 +60,6 @@ func (fastpathAslice) Len() int { return 56 } func (fastpathAslice) Less(i, j int) bool { return fastpathAvRtid[uint(i)] < fastpathAvRtid[uint(j)] } - func (fastpathAslice) Swap(i, j int) { fastpathAvRtid[uint(i)], fastpathAvRtid[uint(j)] = fastpathAvRtid[uint(j)], fastpathAvRtid[uint(i)] fastpathAv[uint(i)], fastpathAv[uint(j)] = fastpathAv[uint(j)], fastpathAv[uint(i)] @@ -640,7 +635,6 @@ func (e *Encoder) fastpathEncSliceIntfR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceIntfV(v, e) } } - func (fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -649,7 +643,6 @@ func (fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceIntfV(v []interface{}, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -663,7 +656,6 @@ func (fastpathT) EncAsMapSliceIntfV(v []interface{}, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceStringR(f *codecFnInfo, rv reflect.Value) { var v []string if rv.Kind() == reflect.Array { @@ -677,7 +669,6 @@ func (e *Encoder) fastpathEncSliceStringR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceStringV(v, e) } } - func (fastpathT) EncSliceStringV(v []string, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -686,7 +677,6 @@ func (fastpathT) EncSliceStringV(v []string, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceStringV(v []string, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -700,7 +690,6 @@ func (fastpathT) EncAsMapSliceStringV(v []string, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceBytesR(f *codecFnInfo, rv reflect.Value) { var v [][]byte if rv.Kind() == reflect.Array { @@ -714,7 +703,6 @@ func (e *Encoder) fastpathEncSliceBytesR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceBytesV(v, e) } } - func (fastpathT) EncSliceBytesV(v [][]byte, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -723,7 +711,6 @@ func (fastpathT) EncSliceBytesV(v [][]byte, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceBytesV(v [][]byte, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -737,7 +724,6 @@ func (fastpathT) EncAsMapSliceBytesV(v [][]byte, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceFloat32R(f *codecFnInfo, rv reflect.Value) { var v []float32 if rv.Kind() == reflect.Array { @@ -751,7 +737,6 @@ func (e *Encoder) fastpathEncSliceFloat32R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceFloat32V(v, e) } } - func (fastpathT) EncSliceFloat32V(v []float32, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -760,7 +745,6 @@ func (fastpathT) EncSliceFloat32V(v []float32, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceFloat32V(v []float32, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -774,7 +758,6 @@ func (fastpathT) EncAsMapSliceFloat32V(v []float32, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceFloat64R(f *codecFnInfo, rv reflect.Value) { var v []float64 if rv.Kind() == reflect.Array { @@ -788,7 +771,6 @@ func (e *Encoder) fastpathEncSliceFloat64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceFloat64V(v, e) } } - func (fastpathT) EncSliceFloat64V(v []float64, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -797,7 +779,6 @@ func (fastpathT) EncSliceFloat64V(v []float64, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceFloat64V(v []float64, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -811,7 +792,6 @@ func (fastpathT) EncAsMapSliceFloat64V(v []float64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceUint8R(f *codecFnInfo, rv reflect.Value) { var v []uint8 if rv.Kind() == reflect.Array { @@ -825,11 +805,9 @@ func (e *Encoder) fastpathEncSliceUint8R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceUint8V(v, e) } } - func (fastpathT) EncSliceUint8V(v []uint8, e *Encoder) { e.e.EncodeStringBytesRaw(v) } - func (fastpathT) EncAsMapSliceUint8V(v []uint8, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -843,7 +821,6 @@ func (fastpathT) EncAsMapSliceUint8V(v []uint8, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceUint64R(f *codecFnInfo, rv reflect.Value) { var v []uint64 if rv.Kind() == reflect.Array { @@ -857,7 +834,6 @@ func (e *Encoder) fastpathEncSliceUint64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceUint64V(v, e) } } - func (fastpathT) EncSliceUint64V(v []uint64, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -866,7 +842,6 @@ func (fastpathT) EncSliceUint64V(v []uint64, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceUint64V(v []uint64, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -880,7 +855,6 @@ func (fastpathT) EncAsMapSliceUint64V(v []uint64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceIntR(f *codecFnInfo, rv reflect.Value) { var v []int if rv.Kind() == reflect.Array { @@ -894,7 +868,6 @@ func (e *Encoder) fastpathEncSliceIntR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceIntV(v, e) } } - func (fastpathT) EncSliceIntV(v []int, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -903,7 +876,6 @@ func (fastpathT) EncSliceIntV(v []int, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceIntV(v []int, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -917,7 +889,6 @@ func (fastpathT) EncAsMapSliceIntV(v []int, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceInt32R(f *codecFnInfo, rv reflect.Value) { var v []int32 if rv.Kind() == reflect.Array { @@ -931,7 +902,6 @@ func (e *Encoder) fastpathEncSliceInt32R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceInt32V(v, e) } } - func (fastpathT) EncSliceInt32V(v []int32, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -940,7 +910,6 @@ func (fastpathT) EncSliceInt32V(v []int32, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceInt32V(v []int32, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -954,7 +923,6 @@ func (fastpathT) EncAsMapSliceInt32V(v []int32, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceInt64R(f *codecFnInfo, rv reflect.Value) { var v []int64 if rv.Kind() == reflect.Array { @@ -968,7 +936,6 @@ func (e *Encoder) fastpathEncSliceInt64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceInt64V(v, e) } } - func (fastpathT) EncSliceInt64V(v []int64, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -977,7 +944,6 @@ func (fastpathT) EncSliceInt64V(v []int64, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceInt64V(v []int64, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -991,7 +957,6 @@ func (fastpathT) EncAsMapSliceInt64V(v []int64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncSliceBoolR(f *codecFnInfo, rv reflect.Value) { var v []bool if rv.Kind() == reflect.Array { @@ -1005,7 +970,6 @@ func (e *Encoder) fastpathEncSliceBoolR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncSliceBoolV(v, e) } } - func (fastpathT) EncSliceBoolV(v []bool, e *Encoder) { e.arrayStart(len(v)) for j := range v { @@ -1014,7 +978,6 @@ func (fastpathT) EncSliceBoolV(v []bool, e *Encoder) { } e.arrayEnd() } - func (fastpathT) EncAsMapSliceBoolV(v []bool, e *Encoder) { e.haltOnMbsOddLen(len(v)) e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2) @@ -1028,11 +991,9 @@ func (fastpathT) EncAsMapSliceBoolV(v []bool, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapStringIntfR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapStringIntfV(rv2i(rv).(map[string]interface{}), e) } - func (fastpathT) EncMapStringIntfV(v map[string]interface{}, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1059,11 +1020,9 @@ func (fastpathT) EncMapStringIntfV(v map[string]interface{}, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapStringStringR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapStringStringV(rv2i(rv).(map[string]string), e) } - func (fastpathT) EncMapStringStringV(v map[string]string, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1090,11 +1049,9 @@ func (fastpathT) EncMapStringStringV(v map[string]string, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapStringBytesR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapStringBytesV(rv2i(rv).(map[string][]byte), e) } - func (fastpathT) EncMapStringBytesV(v map[string][]byte, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1121,11 +1078,9 @@ func (fastpathT) EncMapStringBytesV(v map[string][]byte, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapStringUint8R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapStringUint8V(rv2i(rv).(map[string]uint8), e) } - func (fastpathT) EncMapStringUint8V(v map[string]uint8, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1152,11 +1107,9 @@ func (fastpathT) EncMapStringUint8V(v map[string]uint8, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapStringUint64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapStringUint64V(rv2i(rv).(map[string]uint64), e) } - func (fastpathT) EncMapStringUint64V(v map[string]uint64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1183,11 +1136,9 @@ func (fastpathT) EncMapStringUint64V(v map[string]uint64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapStringIntR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapStringIntV(rv2i(rv).(map[string]int), e) } - func (fastpathT) EncMapStringIntV(v map[string]int, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1214,11 +1165,9 @@ func (fastpathT) EncMapStringIntV(v map[string]int, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapStringInt32R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapStringInt32V(rv2i(rv).(map[string]int32), e) } - func (fastpathT) EncMapStringInt32V(v map[string]int32, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1245,11 +1194,9 @@ func (fastpathT) EncMapStringInt32V(v map[string]int32, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapStringFloat64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapStringFloat64V(rv2i(rv).(map[string]float64), e) } - func (fastpathT) EncMapStringFloat64V(v map[string]float64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1276,11 +1223,9 @@ func (fastpathT) EncMapStringFloat64V(v map[string]float64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapStringBoolR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapStringBoolV(rv2i(rv).(map[string]bool), e) } - func (fastpathT) EncMapStringBoolV(v map[string]bool, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1307,11 +1252,9 @@ func (fastpathT) EncMapStringBoolV(v map[string]bool, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint8IntfR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), e) } - func (fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1338,11 +1281,9 @@ func (fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint8StringR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint8StringV(rv2i(rv).(map[uint8]string), e) } - func (fastpathT) EncMapUint8StringV(v map[uint8]string, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1369,11 +1310,9 @@ func (fastpathT) EncMapUint8StringV(v map[uint8]string, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint8BytesR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint8BytesV(rv2i(rv).(map[uint8][]byte), e) } - func (fastpathT) EncMapUint8BytesV(v map[uint8][]byte, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1400,11 +1339,9 @@ func (fastpathT) EncMapUint8BytesV(v map[uint8][]byte, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), e) } - func (fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1431,11 +1368,9 @@ func (fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), e) } - func (fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1462,11 +1397,9 @@ func (fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint8IntR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint8IntV(rv2i(rv).(map[uint8]int), e) } - func (fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1493,11 +1426,9 @@ func (fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint8Int32R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint8Int32V(rv2i(rv).(map[uint8]int32), e) } - func (fastpathT) EncMapUint8Int32V(v map[uint8]int32, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1524,11 +1455,9 @@ func (fastpathT) EncMapUint8Int32V(v map[uint8]int32, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint8Float64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint8Float64V(rv2i(rv).(map[uint8]float64), e) } - func (fastpathT) EncMapUint8Float64V(v map[uint8]float64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1555,11 +1484,9 @@ func (fastpathT) EncMapUint8Float64V(v map[uint8]float64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint8BoolR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint8BoolV(rv2i(rv).(map[uint8]bool), e) } - func (fastpathT) EncMapUint8BoolV(v map[uint8]bool, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1586,11 +1513,9 @@ func (fastpathT) EncMapUint8BoolV(v map[uint8]bool, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint64IntfR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), e) } - func (fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1617,11 +1542,9 @@ func (fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint64StringR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint64StringV(rv2i(rv).(map[uint64]string), e) } - func (fastpathT) EncMapUint64StringV(v map[uint64]string, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1648,11 +1571,9 @@ func (fastpathT) EncMapUint64StringV(v map[uint64]string, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint64BytesR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint64BytesV(rv2i(rv).(map[uint64][]byte), e) } - func (fastpathT) EncMapUint64BytesV(v map[uint64][]byte, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1679,11 +1600,9 @@ func (fastpathT) EncMapUint64BytesV(v map[uint64][]byte, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), e) } - func (fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1710,11 +1629,9 @@ func (fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), e) } - func (fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1741,11 +1658,9 @@ func (fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint64IntR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint64IntV(rv2i(rv).(map[uint64]int), e) } - func (fastpathT) EncMapUint64IntV(v map[uint64]int, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1772,11 +1687,9 @@ func (fastpathT) EncMapUint64IntV(v map[uint64]int, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint64Int32R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint64Int32V(rv2i(rv).(map[uint64]int32), e) } - func (fastpathT) EncMapUint64Int32V(v map[uint64]int32, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1803,11 +1716,9 @@ func (fastpathT) EncMapUint64Int32V(v map[uint64]int32, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint64Float64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint64Float64V(rv2i(rv).(map[uint64]float64), e) } - func (fastpathT) EncMapUint64Float64V(v map[uint64]float64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1834,11 +1745,9 @@ func (fastpathT) EncMapUint64Float64V(v map[uint64]float64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapUint64BoolR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapUint64BoolV(rv2i(rv).(map[uint64]bool), e) } - func (fastpathT) EncMapUint64BoolV(v map[uint64]bool, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1865,11 +1774,9 @@ func (fastpathT) EncMapUint64BoolV(v map[uint64]bool, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapIntIntfR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapIntIntfV(rv2i(rv).(map[int]interface{}), e) } - func (fastpathT) EncMapIntIntfV(v map[int]interface{}, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1896,11 +1803,9 @@ func (fastpathT) EncMapIntIntfV(v map[int]interface{}, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapIntStringR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapIntStringV(rv2i(rv).(map[int]string), e) } - func (fastpathT) EncMapIntStringV(v map[int]string, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1927,11 +1832,9 @@ func (fastpathT) EncMapIntStringV(v map[int]string, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapIntBytesR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapIntBytesV(rv2i(rv).(map[int][]byte), e) } - func (fastpathT) EncMapIntBytesV(v map[int][]byte, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1958,11 +1861,9 @@ func (fastpathT) EncMapIntBytesV(v map[int][]byte, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapIntUint8R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapIntUint8V(rv2i(rv).(map[int]uint8), e) } - func (fastpathT) EncMapIntUint8V(v map[int]uint8, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -1989,11 +1890,9 @@ func (fastpathT) EncMapIntUint8V(v map[int]uint8, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapIntUint64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapIntUint64V(rv2i(rv).(map[int]uint64), e) } - func (fastpathT) EncMapIntUint64V(v map[int]uint64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2020,11 +1919,9 @@ func (fastpathT) EncMapIntUint64V(v map[int]uint64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapIntIntR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapIntIntV(rv2i(rv).(map[int]int), e) } - func (fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2051,11 +1948,9 @@ func (fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapIntInt32R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapIntInt32V(rv2i(rv).(map[int]int32), e) } - func (fastpathT) EncMapIntInt32V(v map[int]int32, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2082,11 +1977,9 @@ func (fastpathT) EncMapIntInt32V(v map[int]int32, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapIntFloat64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapIntFloat64V(rv2i(rv).(map[int]float64), e) } - func (fastpathT) EncMapIntFloat64V(v map[int]float64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2113,11 +2006,9 @@ func (fastpathT) EncMapIntFloat64V(v map[int]float64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapIntBoolR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapIntBoolV(rv2i(rv).(map[int]bool), e) } - func (fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2144,11 +2035,9 @@ func (fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapInt32IntfR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapInt32IntfV(rv2i(rv).(map[int32]interface{}), e) } - func (fastpathT) EncMapInt32IntfV(v map[int32]interface{}, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2175,11 +2064,9 @@ func (fastpathT) EncMapInt32IntfV(v map[int32]interface{}, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapInt32StringR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapInt32StringV(rv2i(rv).(map[int32]string), e) } - func (fastpathT) EncMapInt32StringV(v map[int32]string, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2206,11 +2093,9 @@ func (fastpathT) EncMapInt32StringV(v map[int32]string, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapInt32BytesR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapInt32BytesV(rv2i(rv).(map[int32][]byte), e) } - func (fastpathT) EncMapInt32BytesV(v map[int32][]byte, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2237,11 +2122,9 @@ func (fastpathT) EncMapInt32BytesV(v map[int32][]byte, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapInt32Uint8R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapInt32Uint8V(rv2i(rv).(map[int32]uint8), e) } - func (fastpathT) EncMapInt32Uint8V(v map[int32]uint8, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2268,11 +2151,9 @@ func (fastpathT) EncMapInt32Uint8V(v map[int32]uint8, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapInt32Uint64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapInt32Uint64V(rv2i(rv).(map[int32]uint64), e) } - func (fastpathT) EncMapInt32Uint64V(v map[int32]uint64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2299,11 +2180,9 @@ func (fastpathT) EncMapInt32Uint64V(v map[int32]uint64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapInt32IntR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapInt32IntV(rv2i(rv).(map[int32]int), e) } - func (fastpathT) EncMapInt32IntV(v map[int32]int, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2330,11 +2209,9 @@ func (fastpathT) EncMapInt32IntV(v map[int32]int, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapInt32Int32R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapInt32Int32V(rv2i(rv).(map[int32]int32), e) } - func (fastpathT) EncMapInt32Int32V(v map[int32]int32, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2361,11 +2238,9 @@ func (fastpathT) EncMapInt32Int32V(v map[int32]int32, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapInt32Float64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapInt32Float64V(rv2i(rv).(map[int32]float64), e) } - func (fastpathT) EncMapInt32Float64V(v map[int32]float64, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -2392,11 +2267,9 @@ func (fastpathT) EncMapInt32Float64V(v map[int32]float64, e *Encoder) { } e.mapEnd() } - func (e *Encoder) fastpathEncMapInt32BoolR(f *codecFnInfo, rv reflect.Value) { fastpathTV.EncMapInt32BoolV(rv2i(rv).(map[int32]bool), e) } - func (fastpathT) EncMapInt32BoolV(v map[int32]bool, e *Encoder) { e.mapStart(len(v)) if e.h.Canonical { @@ -3106,13 +2979,11 @@ func (d *Decoder) fastpathDecSliceIntfR(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceIntfN(rv2i(rv).([]interface{}), d) } } - func (f fastpathT) DecSliceIntfX(vp *[]interface{}, d *Decoder) { if v, changed := f.DecSliceIntfY(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceIntfY(v []interface{}, d *Decoder) (v2 []interface{}, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3170,7 +3041,6 @@ func (fastpathT) DecSliceIntfY(v []interface{}, d *Decoder) (v2 []interface{}, c slh.End() return v, changed } - func (fastpathT) DecSliceIntfN(v []interface{}, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3208,13 +3078,11 @@ func (d *Decoder) fastpathDecSliceStringR(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceStringN(rv2i(rv).([]string), d) } } - func (f fastpathT) DecSliceStringX(vp *[]string, d *Decoder) { if v, changed := f.DecSliceStringY(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceStringY(v []string, d *Decoder) (v2 []string, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3272,7 +3140,6 @@ func (fastpathT) DecSliceStringY(v []string, d *Decoder) (v2 []string, changed b slh.End() return v, changed } - func (fastpathT) DecSliceStringN(v []string, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3310,13 +3177,11 @@ func (d *Decoder) fastpathDecSliceBytesR(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceBytesN(rv2i(rv).([][]byte), d) } } - func (f fastpathT) DecSliceBytesX(vp *[][]byte, d *Decoder) { if v, changed := f.DecSliceBytesY(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceBytesY(v [][]byte, d *Decoder) (v2 [][]byte, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3374,7 +3239,6 @@ func (fastpathT) DecSliceBytesY(v [][]byte, d *Decoder) (v2 [][]byte, changed bo slh.End() return v, changed } - func (fastpathT) DecSliceBytesN(v [][]byte, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3412,13 +3276,11 @@ func (d *Decoder) fastpathDecSliceFloat32R(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceFloat32N(rv2i(rv).([]float32), d) } } - func (f fastpathT) DecSliceFloat32X(vp *[]float32, d *Decoder) { if v, changed := f.DecSliceFloat32Y(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceFloat32Y(v []float32, d *Decoder) (v2 []float32, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3476,7 +3338,6 @@ func (fastpathT) DecSliceFloat32Y(v []float32, d *Decoder) (v2 []float32, change slh.End() return v, changed } - func (fastpathT) DecSliceFloat32N(v []float32, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3514,13 +3375,11 @@ func (d *Decoder) fastpathDecSliceFloat64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceFloat64N(rv2i(rv).([]float64), d) } } - func (f fastpathT) DecSliceFloat64X(vp *[]float64, d *Decoder) { if v, changed := f.DecSliceFloat64Y(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceFloat64Y(v []float64, d *Decoder) (v2 []float64, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3578,7 +3437,6 @@ func (fastpathT) DecSliceFloat64Y(v []float64, d *Decoder) (v2 []float64, change slh.End() return v, changed } - func (fastpathT) DecSliceFloat64N(v []float64, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3616,13 +3474,11 @@ func (d *Decoder) fastpathDecSliceUint8R(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceUint8N(rv2i(rv).([]uint8), d) } } - func (f fastpathT) DecSliceUint8X(vp *[]uint8, d *Decoder) { if v, changed := f.DecSliceUint8Y(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceUint8Y(v []uint8, d *Decoder) (v2 []uint8, changed bool) { switch d.d.ContainerType() { case valueTypeNil, valueTypeMap: @@ -3688,7 +3544,6 @@ func (fastpathT) DecSliceUint8Y(v []uint8, d *Decoder) (v2 []uint8, changed bool slh.End() return v, changed } - func (fastpathT) DecSliceUint8N(v []uint8, d *Decoder) { switch d.d.ContainerType() { case valueTypeNil, valueTypeMap: @@ -3736,13 +3591,11 @@ func (d *Decoder) fastpathDecSliceUint64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceUint64N(rv2i(rv).([]uint64), d) } } - func (f fastpathT) DecSliceUint64X(vp *[]uint64, d *Decoder) { if v, changed := f.DecSliceUint64Y(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceUint64Y(v []uint64, d *Decoder) (v2 []uint64, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3800,7 +3653,6 @@ func (fastpathT) DecSliceUint64Y(v []uint64, d *Decoder) (v2 []uint64, changed b slh.End() return v, changed } - func (fastpathT) DecSliceUint64N(v []uint64, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3838,13 +3690,11 @@ func (d *Decoder) fastpathDecSliceIntR(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceIntN(rv2i(rv).([]int), d) } } - func (f fastpathT) DecSliceIntX(vp *[]int, d *Decoder) { if v, changed := f.DecSliceIntY(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceIntY(v []int, d *Decoder) (v2 []int, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3902,7 +3752,6 @@ func (fastpathT) DecSliceIntY(v []int, d *Decoder) (v2 []int, changed bool) { slh.End() return v, changed } - func (fastpathT) DecSliceIntN(v []int, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -3940,13 +3789,11 @@ func (d *Decoder) fastpathDecSliceInt32R(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceInt32N(rv2i(rv).([]int32), d) } } - func (f fastpathT) DecSliceInt32X(vp *[]int32, d *Decoder) { if v, changed := f.DecSliceInt32Y(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceInt32Y(v []int32, d *Decoder) (v2 []int32, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -4004,7 +3851,6 @@ func (fastpathT) DecSliceInt32Y(v []int32, d *Decoder) (v2 []int32, changed bool slh.End() return v, changed } - func (fastpathT) DecSliceInt32N(v []int32, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -4042,13 +3888,11 @@ func (d *Decoder) fastpathDecSliceInt64R(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceInt64N(rv2i(rv).([]int64), d) } } - func (f fastpathT) DecSliceInt64X(vp *[]int64, d *Decoder) { if v, changed := f.DecSliceInt64Y(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceInt64Y(v []int64, d *Decoder) (v2 []int64, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -4106,7 +3950,6 @@ func (fastpathT) DecSliceInt64Y(v []int64, d *Decoder) (v2 []int64, changed bool slh.End() return v, changed } - func (fastpathT) DecSliceInt64N(v []int64, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -4144,13 +3987,11 @@ func (d *Decoder) fastpathDecSliceBoolR(f *codecFnInfo, rv reflect.Value) { fastpathTV.DecSliceBoolN(rv2i(rv).([]bool), d) } } - func (f fastpathT) DecSliceBoolX(vp *[]bool, d *Decoder) { if v, changed := f.DecSliceBoolY(*vp, d); changed { *vp = v } } - func (fastpathT) DecSliceBoolY(v []bool, d *Decoder) (v2 []bool, changed bool) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -4208,7 +4049,6 @@ func (fastpathT) DecSliceBoolY(v []bool, d *Decoder) (v2 []bool, changed bool) { slh.End() return v, changed } - func (fastpathT) DecSliceBoolN(v []bool, d *Decoder) { slh, containerLenS := d.decSliceHelperStart() if slh.IsNil { @@ -4229,7 +4069,6 @@ func (fastpathT) DecSliceBoolN(v []bool, d *Decoder) { } slh.End() } - func (d *Decoder) fastpathDecMapStringIntfR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4245,7 +4084,6 @@ func (d *Decoder) fastpathDecMapStringIntfR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4260,7 +4098,6 @@ func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapStringIntfL(v map[string]interface{}, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[string]interface{} given stream length: %v", containerLen) @@ -4283,7 +4120,6 @@ func (fastpathT) DecMapStringIntfL(v map[string]interface{}, containerLen int, d v[mk] = mv } } - func (d *Decoder) fastpathDecMapStringStringR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4299,7 +4135,6 @@ func (d *Decoder) fastpathDecMapStringStringR(f *codecFnInfo, rv reflect.Value) } d.mapEnd() } - func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4314,7 +4149,6 @@ func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapStringStringL(v map[string]string, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[string]string given stream length: %v", containerLen) @@ -4331,7 +4165,6 @@ func (fastpathT) DecMapStringStringL(v map[string]string, containerLen int, d *D v[mk] = mv } } - func (d *Decoder) fastpathDecMapStringBytesR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4347,7 +4180,6 @@ func (d *Decoder) fastpathDecMapStringBytesR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapStringBytesX(vp *map[string][]byte, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4362,7 +4194,6 @@ func (f fastpathT) DecMapStringBytesX(vp *map[string][]byte, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapStringBytesL(v map[string][]byte, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[string][]byte given stream length: %v", containerLen) @@ -4385,7 +4216,6 @@ func (fastpathT) DecMapStringBytesL(v map[string][]byte, containerLen int, d *De v[mk] = mv } } - func (d *Decoder) fastpathDecMapStringUint8R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4401,7 +4231,6 @@ func (d *Decoder) fastpathDecMapStringUint8R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4416,7 +4245,6 @@ func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapStringUint8L(v map[string]uint8, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[string]uint8 given stream length: %v", containerLen) @@ -4433,7 +4261,6 @@ func (fastpathT) DecMapStringUint8L(v map[string]uint8, containerLen int, d *Dec v[mk] = mv } } - func (d *Decoder) fastpathDecMapStringUint64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4449,7 +4276,6 @@ func (d *Decoder) fastpathDecMapStringUint64R(f *codecFnInfo, rv reflect.Value) } d.mapEnd() } - func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4464,7 +4290,6 @@ func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapStringUint64L(v map[string]uint64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[string]uint64 given stream length: %v", containerLen) @@ -4481,7 +4306,6 @@ func (fastpathT) DecMapStringUint64L(v map[string]uint64, containerLen int, d *D v[mk] = mv } } - func (d *Decoder) fastpathDecMapStringIntR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4497,7 +4321,6 @@ func (d *Decoder) fastpathDecMapStringIntR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4512,7 +4335,6 @@ func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapStringIntL(v map[string]int, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[string]int given stream length: %v", containerLen) @@ -4529,7 +4351,6 @@ func (fastpathT) DecMapStringIntL(v map[string]int, containerLen int, d *Decoder v[mk] = mv } } - func (d *Decoder) fastpathDecMapStringInt32R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4545,7 +4366,6 @@ func (d *Decoder) fastpathDecMapStringInt32R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapStringInt32X(vp *map[string]int32, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4560,7 +4380,6 @@ func (f fastpathT) DecMapStringInt32X(vp *map[string]int32, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapStringInt32L(v map[string]int32, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[string]int32 given stream length: %v", containerLen) @@ -4577,7 +4396,6 @@ func (fastpathT) DecMapStringInt32L(v map[string]int32, containerLen int, d *Dec v[mk] = mv } } - func (d *Decoder) fastpathDecMapStringFloat64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4593,7 +4411,6 @@ func (d *Decoder) fastpathDecMapStringFloat64R(f *codecFnInfo, rv reflect.Value) } d.mapEnd() } - func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4608,7 +4425,6 @@ func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapStringFloat64L(v map[string]float64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[string]float64 given stream length: %v", containerLen) @@ -4625,7 +4441,6 @@ func (fastpathT) DecMapStringFloat64L(v map[string]float64, containerLen int, d v[mk] = mv } } - func (d *Decoder) fastpathDecMapStringBoolR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4641,7 +4456,6 @@ func (d *Decoder) fastpathDecMapStringBoolR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4656,7 +4470,6 @@ func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapStringBoolL(v map[string]bool, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[string]bool given stream length: %v", containerLen) @@ -4673,7 +4486,6 @@ func (fastpathT) DecMapStringBoolL(v map[string]bool, containerLen int, d *Decod v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint8IntfR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4689,7 +4501,6 @@ func (d *Decoder) fastpathDecMapUint8IntfR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4704,7 +4515,6 @@ func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint8IntfL(v map[uint8]interface{}, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint8]interface{} given stream length: %v", containerLen) @@ -4727,7 +4537,6 @@ func (fastpathT) DecMapUint8IntfL(v map[uint8]interface{}, containerLen int, d * v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint8StringR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4743,7 +4552,6 @@ func (d *Decoder) fastpathDecMapUint8StringR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4758,7 +4566,6 @@ func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint8StringL(v map[uint8]string, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint8]string given stream length: %v", containerLen) @@ -4775,7 +4582,6 @@ func (fastpathT) DecMapUint8StringL(v map[uint8]string, containerLen int, d *Dec v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint8BytesR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4791,7 +4597,6 @@ func (d *Decoder) fastpathDecMapUint8BytesR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint8BytesX(vp *map[uint8][]byte, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4806,7 +4611,6 @@ func (f fastpathT) DecMapUint8BytesX(vp *map[uint8][]byte, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint8BytesL(v map[uint8][]byte, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint8][]byte given stream length: %v", containerLen) @@ -4829,7 +4633,6 @@ func (fastpathT) DecMapUint8BytesL(v map[uint8][]byte, containerLen int, d *Deco v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4845,7 +4648,6 @@ func (d *Decoder) fastpathDecMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4860,7 +4662,6 @@ func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint8Uint8L(v map[uint8]uint8, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint8]uint8 given stream length: %v", containerLen) @@ -4877,7 +4678,6 @@ func (fastpathT) DecMapUint8Uint8L(v map[uint8]uint8, containerLen int, d *Decod v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4893,7 +4693,6 @@ func (d *Decoder) fastpathDecMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4908,7 +4707,6 @@ func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint8Uint64L(v map[uint8]uint64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint8]uint64 given stream length: %v", containerLen) @@ -4925,7 +4723,6 @@ func (fastpathT) DecMapUint8Uint64L(v map[uint8]uint64, containerLen int, d *Dec v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint8IntR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4941,7 +4738,6 @@ func (d *Decoder) fastpathDecMapUint8IntR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -4956,7 +4752,6 @@ func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint8IntL(v map[uint8]int, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint8]int given stream length: %v", containerLen) @@ -4973,7 +4768,6 @@ func (fastpathT) DecMapUint8IntL(v map[uint8]int, containerLen int, d *Decoder) v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint8Int32R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -4989,7 +4783,6 @@ func (d *Decoder) fastpathDecMapUint8Int32R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint8Int32X(vp *map[uint8]int32, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5004,7 +4797,6 @@ func (f fastpathT) DecMapUint8Int32X(vp *map[uint8]int32, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint8Int32L(v map[uint8]int32, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint8]int32 given stream length: %v", containerLen) @@ -5021,7 +4813,6 @@ func (fastpathT) DecMapUint8Int32L(v map[uint8]int32, containerLen int, d *Decod v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint8Float64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5037,7 +4828,6 @@ func (d *Decoder) fastpathDecMapUint8Float64R(f *codecFnInfo, rv reflect.Value) } d.mapEnd() } - func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5052,7 +4842,6 @@ func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint8Float64L(v map[uint8]float64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint8]float64 given stream length: %v", containerLen) @@ -5069,7 +4858,6 @@ func (fastpathT) DecMapUint8Float64L(v map[uint8]float64, containerLen int, d *D v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint8BoolR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5085,7 +4873,6 @@ func (d *Decoder) fastpathDecMapUint8BoolR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5100,7 +4887,6 @@ func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint8BoolL(v map[uint8]bool, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint8]bool given stream length: %v", containerLen) @@ -5117,7 +4903,6 @@ func (fastpathT) DecMapUint8BoolL(v map[uint8]bool, containerLen int, d *Decoder v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint64IntfR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5133,7 +4918,6 @@ func (d *Decoder) fastpathDecMapUint64IntfR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5148,7 +4932,6 @@ func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint64IntfL(v map[uint64]interface{}, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint64]interface{} given stream length: %v", containerLen) @@ -5171,7 +4954,6 @@ func (fastpathT) DecMapUint64IntfL(v map[uint64]interface{}, containerLen int, d v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint64StringR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5187,7 +4969,6 @@ func (d *Decoder) fastpathDecMapUint64StringR(f *codecFnInfo, rv reflect.Value) } d.mapEnd() } - func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5202,7 +4983,6 @@ func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint64StringL(v map[uint64]string, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint64]string given stream length: %v", containerLen) @@ -5219,7 +4999,6 @@ func (fastpathT) DecMapUint64StringL(v map[uint64]string, containerLen int, d *D v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint64BytesR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5235,7 +5014,6 @@ func (d *Decoder) fastpathDecMapUint64BytesR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint64BytesX(vp *map[uint64][]byte, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5250,7 +5028,6 @@ func (f fastpathT) DecMapUint64BytesX(vp *map[uint64][]byte, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint64BytesL(v map[uint64][]byte, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint64][]byte given stream length: %v", containerLen) @@ -5273,7 +5050,6 @@ func (fastpathT) DecMapUint64BytesL(v map[uint64][]byte, containerLen int, d *De v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5289,7 +5065,6 @@ func (d *Decoder) fastpathDecMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5304,7 +5079,6 @@ func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint64Uint8L(v map[uint64]uint8, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint64]uint8 given stream length: %v", containerLen) @@ -5321,7 +5095,6 @@ func (fastpathT) DecMapUint64Uint8L(v map[uint64]uint8, containerLen int, d *Dec v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5337,7 +5110,6 @@ func (d *Decoder) fastpathDecMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) } d.mapEnd() } - func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5352,7 +5124,6 @@ func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint64Uint64L(v map[uint64]uint64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint64]uint64 given stream length: %v", containerLen) @@ -5369,7 +5140,6 @@ func (fastpathT) DecMapUint64Uint64L(v map[uint64]uint64, containerLen int, d *D v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint64IntR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5385,7 +5155,6 @@ func (d *Decoder) fastpathDecMapUint64IntR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5400,7 +5169,6 @@ func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint64IntL(v map[uint64]int, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint64]int given stream length: %v", containerLen) @@ -5417,7 +5185,6 @@ func (fastpathT) DecMapUint64IntL(v map[uint64]int, containerLen int, d *Decoder v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint64Int32R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5433,7 +5200,6 @@ func (d *Decoder) fastpathDecMapUint64Int32R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint64Int32X(vp *map[uint64]int32, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5448,7 +5214,6 @@ func (f fastpathT) DecMapUint64Int32X(vp *map[uint64]int32, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint64Int32L(v map[uint64]int32, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint64]int32 given stream length: %v", containerLen) @@ -5465,7 +5230,6 @@ func (fastpathT) DecMapUint64Int32L(v map[uint64]int32, containerLen int, d *Dec v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint64Float64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5481,7 +5245,6 @@ func (d *Decoder) fastpathDecMapUint64Float64R(f *codecFnInfo, rv reflect.Value) } d.mapEnd() } - func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5496,7 +5259,6 @@ func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint64Float64L(v map[uint64]float64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint64]float64 given stream length: %v", containerLen) @@ -5513,7 +5275,6 @@ func (fastpathT) DecMapUint64Float64L(v map[uint64]float64, containerLen int, d v[mk] = mv } } - func (d *Decoder) fastpathDecMapUint64BoolR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5529,7 +5290,6 @@ func (d *Decoder) fastpathDecMapUint64BoolR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5544,7 +5304,6 @@ func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapUint64BoolL(v map[uint64]bool, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[uint64]bool given stream length: %v", containerLen) @@ -5561,7 +5320,6 @@ func (fastpathT) DecMapUint64BoolL(v map[uint64]bool, containerLen int, d *Decod v[mk] = mv } } - func (d *Decoder) fastpathDecMapIntIntfR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5577,7 +5335,6 @@ func (d *Decoder) fastpathDecMapIntIntfR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5592,7 +5349,6 @@ func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapIntIntfL(v map[int]interface{}, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int]interface{} given stream length: %v", containerLen) @@ -5615,7 +5371,6 @@ func (fastpathT) DecMapIntIntfL(v map[int]interface{}, containerLen int, d *Deco v[mk] = mv } } - func (d *Decoder) fastpathDecMapIntStringR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5631,7 +5386,6 @@ func (d *Decoder) fastpathDecMapIntStringR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5646,7 +5400,6 @@ func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapIntStringL(v map[int]string, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int]string given stream length: %v", containerLen) @@ -5663,7 +5416,6 @@ func (fastpathT) DecMapIntStringL(v map[int]string, containerLen int, d *Decoder v[mk] = mv } } - func (d *Decoder) fastpathDecMapIntBytesR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5679,7 +5431,6 @@ func (d *Decoder) fastpathDecMapIntBytesR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapIntBytesX(vp *map[int][]byte, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5694,7 +5445,6 @@ func (f fastpathT) DecMapIntBytesX(vp *map[int][]byte, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapIntBytesL(v map[int][]byte, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int][]byte given stream length: %v", containerLen) @@ -5717,7 +5467,6 @@ func (fastpathT) DecMapIntBytesL(v map[int][]byte, containerLen int, d *Decoder) v[mk] = mv } } - func (d *Decoder) fastpathDecMapIntUint8R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5733,7 +5482,6 @@ func (d *Decoder) fastpathDecMapIntUint8R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5748,7 +5496,6 @@ func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapIntUint8L(v map[int]uint8, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int]uint8 given stream length: %v", containerLen) @@ -5765,7 +5512,6 @@ func (fastpathT) DecMapIntUint8L(v map[int]uint8, containerLen int, d *Decoder) v[mk] = mv } } - func (d *Decoder) fastpathDecMapIntUint64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5781,7 +5527,6 @@ func (d *Decoder) fastpathDecMapIntUint64R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5796,7 +5541,6 @@ func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapIntUint64L(v map[int]uint64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int]uint64 given stream length: %v", containerLen) @@ -5813,7 +5557,6 @@ func (fastpathT) DecMapIntUint64L(v map[int]uint64, containerLen int, d *Decoder v[mk] = mv } } - func (d *Decoder) fastpathDecMapIntIntR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5829,7 +5572,6 @@ func (d *Decoder) fastpathDecMapIntIntR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5844,7 +5586,6 @@ func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapIntIntL(v map[int]int, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int]int given stream length: %v", containerLen) @@ -5861,7 +5602,6 @@ func (fastpathT) DecMapIntIntL(v map[int]int, containerLen int, d *Decoder) { v[mk] = mv } } - func (d *Decoder) fastpathDecMapIntInt32R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5877,7 +5617,6 @@ func (d *Decoder) fastpathDecMapIntInt32R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapIntInt32X(vp *map[int]int32, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5892,7 +5631,6 @@ func (f fastpathT) DecMapIntInt32X(vp *map[int]int32, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapIntInt32L(v map[int]int32, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int]int32 given stream length: %v", containerLen) @@ -5909,7 +5647,6 @@ func (fastpathT) DecMapIntInt32L(v map[int]int32, containerLen int, d *Decoder) v[mk] = mv } } - func (d *Decoder) fastpathDecMapIntFloat64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5925,7 +5662,6 @@ func (d *Decoder) fastpathDecMapIntFloat64R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5940,7 +5676,6 @@ func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapIntFloat64L(v map[int]float64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int]float64 given stream length: %v", containerLen) @@ -5957,7 +5692,6 @@ func (fastpathT) DecMapIntFloat64L(v map[int]float64, containerLen int, d *Decod v[mk] = mv } } - func (d *Decoder) fastpathDecMapIntBoolR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -5973,7 +5707,6 @@ func (d *Decoder) fastpathDecMapIntBoolR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -5988,7 +5721,6 @@ func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapIntBoolL(v map[int]bool, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int]bool given stream length: %v", containerLen) @@ -6005,7 +5737,6 @@ func (fastpathT) DecMapIntBoolL(v map[int]bool, containerLen int, d *Decoder) { v[mk] = mv } } - func (d *Decoder) fastpathDecMapInt32IntfR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -6021,7 +5752,6 @@ func (d *Decoder) fastpathDecMapInt32IntfR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapInt32IntfX(vp *map[int32]interface{}, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -6036,7 +5766,6 @@ func (f fastpathT) DecMapInt32IntfX(vp *map[int32]interface{}, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapInt32IntfL(v map[int32]interface{}, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int32]interface{} given stream length: %v", containerLen) @@ -6059,7 +5788,6 @@ func (fastpathT) DecMapInt32IntfL(v map[int32]interface{}, containerLen int, d * v[mk] = mv } } - func (d *Decoder) fastpathDecMapInt32StringR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -6075,7 +5803,6 @@ func (d *Decoder) fastpathDecMapInt32StringR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapInt32StringX(vp *map[int32]string, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -6090,7 +5817,6 @@ func (f fastpathT) DecMapInt32StringX(vp *map[int32]string, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapInt32StringL(v map[int32]string, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int32]string given stream length: %v", containerLen) @@ -6107,7 +5833,6 @@ func (fastpathT) DecMapInt32StringL(v map[int32]string, containerLen int, d *Dec v[mk] = mv } } - func (d *Decoder) fastpathDecMapInt32BytesR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -6123,7 +5848,6 @@ func (d *Decoder) fastpathDecMapInt32BytesR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapInt32BytesX(vp *map[int32][]byte, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -6138,7 +5862,6 @@ func (f fastpathT) DecMapInt32BytesX(vp *map[int32][]byte, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapInt32BytesL(v map[int32][]byte, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int32][]byte given stream length: %v", containerLen) @@ -6161,7 +5884,6 @@ func (fastpathT) DecMapInt32BytesL(v map[int32][]byte, containerLen int, d *Deco v[mk] = mv } } - func (d *Decoder) fastpathDecMapInt32Uint8R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -6177,7 +5899,6 @@ func (d *Decoder) fastpathDecMapInt32Uint8R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapInt32Uint8X(vp *map[int32]uint8, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -6192,7 +5913,6 @@ func (f fastpathT) DecMapInt32Uint8X(vp *map[int32]uint8, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapInt32Uint8L(v map[int32]uint8, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int32]uint8 given stream length: %v", containerLen) @@ -6209,7 +5929,6 @@ func (fastpathT) DecMapInt32Uint8L(v map[int32]uint8, containerLen int, d *Decod v[mk] = mv } } - func (d *Decoder) fastpathDecMapInt32Uint64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -6225,7 +5944,6 @@ func (d *Decoder) fastpathDecMapInt32Uint64R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapInt32Uint64X(vp *map[int32]uint64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -6240,7 +5958,6 @@ func (f fastpathT) DecMapInt32Uint64X(vp *map[int32]uint64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapInt32Uint64L(v map[int32]uint64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int32]uint64 given stream length: %v", containerLen) @@ -6257,7 +5974,6 @@ func (fastpathT) DecMapInt32Uint64L(v map[int32]uint64, containerLen int, d *Dec v[mk] = mv } } - func (d *Decoder) fastpathDecMapInt32IntR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -6273,7 +5989,6 @@ func (d *Decoder) fastpathDecMapInt32IntR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapInt32IntX(vp *map[int32]int, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -6288,7 +6003,6 @@ func (f fastpathT) DecMapInt32IntX(vp *map[int32]int, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapInt32IntL(v map[int32]int, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int32]int given stream length: %v", containerLen) @@ -6305,7 +6019,6 @@ func (fastpathT) DecMapInt32IntL(v map[int32]int, containerLen int, d *Decoder) v[mk] = mv } } - func (d *Decoder) fastpathDecMapInt32Int32R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -6321,7 +6034,6 @@ func (d *Decoder) fastpathDecMapInt32Int32R(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapInt32Int32X(vp *map[int32]int32, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -6336,7 +6048,6 @@ func (f fastpathT) DecMapInt32Int32X(vp *map[int32]int32, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapInt32Int32L(v map[int32]int32, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int32]int32 given stream length: %v", containerLen) @@ -6353,7 +6064,6 @@ func (fastpathT) DecMapInt32Int32L(v map[int32]int32, containerLen int, d *Decod v[mk] = mv } } - func (d *Decoder) fastpathDecMapInt32Float64R(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -6369,7 +6079,6 @@ func (d *Decoder) fastpathDecMapInt32Float64R(f *codecFnInfo, rv reflect.Value) } d.mapEnd() } - func (f fastpathT) DecMapInt32Float64X(vp *map[int32]float64, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -6384,7 +6093,6 @@ func (f fastpathT) DecMapInt32Float64X(vp *map[int32]float64, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapInt32Float64L(v map[int32]float64, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int32]float64 given stream length: %v", containerLen) @@ -6401,7 +6109,6 @@ func (fastpathT) DecMapInt32Float64L(v map[int32]float64, containerLen int, d *D v[mk] = mv } } - func (d *Decoder) fastpathDecMapInt32BoolR(f *codecFnInfo, rv reflect.Value) { containerLen := d.mapStart(d.d.ReadMapStart()) if rv.Kind() == reflect.Ptr { @@ -6417,7 +6124,6 @@ func (d *Decoder) fastpathDecMapInt32BoolR(f *codecFnInfo, rv reflect.Value) { } d.mapEnd() } - func (f fastpathT) DecMapInt32BoolX(vp *map[int32]bool, d *Decoder) { containerLen := d.mapStart(d.d.ReadMapStart()) if containerLen == containerLenNil { @@ -6432,7 +6138,6 @@ func (f fastpathT) DecMapInt32BoolX(vp *map[int32]bool, d *Decoder) { d.mapEnd() } } - func (fastpathT) DecMapInt32BoolL(v map[int32]bool, containerLen int, d *Decoder) { if v == nil { d.errorf("cannot decode into nil map[int32]bool given stream length: %v", containerLen) diff --git a/vendor/github.com/ugorji/go/codec/fast-path.not.go b/vendor/github.com/ugorji/go/codec/fast-path.not.go index dc7e31e..259485d 100644 --- a/vendor/github.com/ugorji/go/codec/fast-path.not.go +++ b/vendor/github.com/ugorji/go/codec/fast-path.not.go @@ -25,23 +25,19 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false } func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { return false } -type ( - fastpathT struct{} - fastpathE struct { - rtid uintptr - rt reflect.Type - encfn func(*Encoder, *codecFnInfo, reflect.Value) - decfn func(*Decoder, *codecFnInfo, reflect.Value) - } -) +type fastpathT struct{} +type fastpathE struct { + rtid uintptr + rt reflect.Type + encfn func(*Encoder, *codecFnInfo, reflect.Value) + decfn func(*Decoder, *codecFnInfo, reflect.Value) +} type fastpathA [0]fastpathE func fastpathAvIndex(rtid uintptr) int { return -1 } -var ( - fastpathAv fastpathA - fastpathTV fastpathT -) +var fastpathAv fastpathA +var fastpathTV fastpathT // ---- type TestMammoth2Wrapper struct{} // to allow testMammoth work in notfastpath mode diff --git a/vendor/github.com/ugorji/go/codec/gen.go b/vendor/github.com/ugorji/go/codec/gen.go index 4e7dfd7..5c5f925 100644 --- a/vendor/github.com/ugorji/go/codec/gen.go +++ b/vendor/github.com/ugorji/go/codec/gen.go @@ -175,16 +175,12 @@ const ( genDecStructArrayInlineLoopCheck = true ) -type ( - genStructMapStyle uint8 - genStringDecAsBytes string - genStringDecZC string -) +type genStructMapStyle uint8 +type genStringDecAsBytes string +type genStringDecZC string -var ( - genStringDecAsBytesTyp = reflect.TypeOf(genStringDecAsBytes("")) - genStringDecZCTyp = reflect.TypeOf(genStringDecZC("")) -) +var genStringDecAsBytesTyp = reflect.TypeOf(genStringDecAsBytes("")) +var genStringDecZCTyp = reflect.TypeOf(genStringDecZC("")) const ( genStructMapStyleConsolidated genStructMapStyle = iota @@ -761,6 +757,7 @@ func (x *genRunner) selfer(encode bool) { x.decStructArray(genTopLevelVarName, "l", "return", rt2id(t0), t0) x.line("}") x.line("") + } // used for chan, array, slice, map @@ -1122,7 +1119,7 @@ func (x *genRunner) encOmitEmptyLine(t2 reflect.StructField, varname string, buf buf.s(" || ") x.encOmitEmptyLine(f, varname2, buf) } - // buf.s(")") + //buf.s(")") case reflect.Bool: buf.s("bool(").s(varname2).s(")") case reflect.Map, reflect.Slice, reflect.Array, reflect.Chan: @@ -1382,7 +1379,7 @@ func (x *genRunner) encMapFallback(varname string, t reflect.Type) { func (x *genRunner) decVarInitPtr(varname, nilvar string, t reflect.Type, si *structFieldInfo, newbuf, nilbuf *genBuf) (varname3 string, t2 reflect.StructField) { - // we must accommodate anonymous fields, where the embedded field is a nil pointer in the value. + //we must accommodate anonymous fields, where the embedded field is a nil pointer in the value. // t2 = t.FieldByIndex(si.is) varname3 = varname t2typ := t @@ -1480,6 +1477,7 @@ func (x *genRunner) decVarMain(varname, rand string, t reflect.Type, checkNotNil // decVar takes a variable called varname, of type t func (x *genRunner) decVar(varname, nilvar string, t reflect.Type, canBeNil, checkNotNil bool) { + // We only encode as nil if a nillable value. // This removes some of the wasted checks for TryDecodeAsNil. // We need to think about this more, to see what happens if omitempty, etc @@ -2176,14 +2174,12 @@ func genInternalZeroValue(s string) string { } } -var ( - genInternalNonZeroValueIdx [6]uint64 - genInternalNonZeroValueStrs = [...][6]string{ - {`"string-is-an-interface-1"`, "true", `"some-string-1"`, `[]byte("some-string-1")`, "11.1", "111"}, - {`"string-is-an-interface-2"`, "false", `"some-string-2"`, `[]byte("some-string-2")`, "22.2", "77"}, - {`"string-is-an-interface-3"`, "true", `"some-string-3"`, `[]byte("some-string-3")`, "33.3e3", "127"}, - } -) +var genInternalNonZeroValueIdx [6]uint64 +var genInternalNonZeroValueStrs = [...][6]string{ + {`"string-is-an-interface-1"`, "true", `"some-string-1"`, `[]byte("some-string-1")`, "11.1", "111"}, + {`"string-is-an-interface-2"`, "false", `"some-string-2"`, `[]byte("some-string-2")`, "22.2", "77"}, + {`"string-is-an-interface-3"`, "true", `"some-string-3"`, `[]byte("some-string-3")`, "33.3e3", "127"}, +} // Note: last numbers must be in range: 0-127 (as they may be put into a int8, uint8, etc) @@ -2334,11 +2330,9 @@ func genStripVendor(s string) string { } // var genInternalMu sync.Mutex -var ( - genInternalV = genInternal{Version: genVersion} - genInternalTmplFuncs template.FuncMap - genInternalOnce sync.Once -) +var genInternalV = genInternal{Version: genVersion} +var genInternalTmplFuncs template.FuncMap +var genInternalOnce sync.Once func genInternalInit() { wordSizeBytes := int(intBitsize) / 8 @@ -2368,7 +2362,7 @@ func genInternalInit() { // keep as slice, so it is in specific iteration order. // Initial order was uint64, string, interface{}, int, int64, ... - types := [...]string{ + var types = [...]string{ "interface{}", "string", "[]byte", @@ -2415,7 +2409,7 @@ func genInternalInit() { // } // var mapkeytypestr = string(mb) - gt := genInternal{Version: genVersion} + var gt = genInternal{Version: genVersion} // For each slice or map type, there must be a (symmetrical) Encode and Decode fast-path function diff --git a/vendor/github.com/ugorji/go/codec/helper.go b/vendor/github.com/ugorji/go/codec/helper.go index 2c0df0a..4a886c7 100644 --- a/vendor/github.com/ugorji/go/codec/helper.go +++ b/vendor/github.com/ugorji/go/codec/helper.go @@ -530,7 +530,6 @@ func (x *typeInfoLoad) reset() { type jsonMarshaler interface { MarshalJSON() ([]byte, error) } - type jsonUnmarshaler interface { UnmarshalJSON([]byte) error } @@ -850,7 +849,7 @@ func (x *BasicHandle) initHandle(hh Handle) { x.mu.Lock() defer x.mu.Unlock() // use defer, as halt may panic below if x.inited == 0 { - f := initedHandleFlag + var f = initedHandleFlag if hh.isBinary() { f |= binaryHandleFlag } @@ -887,7 +886,7 @@ func findRtidFn(s []codecRtidFn, rtid uintptr) (i uint, fn *codecFn) { // h, i, j := 0, 0, len(s) var h uint // var h, i uint - j := uint(len(s)) + var j = uint(len(s)) LOOP: if i < j { h = (i + j) >> 1 // avoid overflow when computing h // h = i + (j-i)/2 @@ -991,7 +990,7 @@ func (x *BasicHandle) fnLoad(rt reflect.Type, rtid uintptr, checkExt bool) (fn * } else if supportMarshalInterfaces && !x.isBe() && x.isJs() && (ti.flagJsonMarshaler || ti.flagJsonMarshalerPtr) && (ti.flagJsonUnmarshaler || ti.flagJsonUnmarshalerPtr) { - // If JSON, we should check JSONMarshal before textMarshal + //If JSON, we should check JSONMarshal before textMarshal fn.fe = (*Encoder).jsonMarshal fn.fd = (*Decoder).jsonUnmarshal fi.addrD = ti.flagJsonUnmarshalerPtr @@ -1299,7 +1298,6 @@ func (bytesExtFailer) WriteExt(v interface{}) []byte { halt.onerror(errExtFnWriteExtUnsupported) return nil } - func (bytesExtFailer) ReadExt(v interface{}, bs []byte) { halt.onerror(errExtFnReadExtUnsupported) } @@ -1310,7 +1308,6 @@ func (interfaceExtFailer) ConvertExt(v interface{}) interface{} { halt.onerror(errExtFnConvertExtUnsupported) return nil } - func (interfaceExtFailer) UpdateExt(dest interface{}, v interface{}) { halt.onerror(errExtFnUpdateExtUnsupported) } @@ -1884,7 +1881,7 @@ func findTypeInfo(s []rtid2ti, rtid uintptr) (i uint, ti *typeInfo) { // Note: we use goto (instead of for loop) so this can be inlined. var h uint - j := uint(len(s)) + var j = uint(len(s)) LOOP: if i < j { h = (i + j) >> 1 // avoid overflow when computing h // h = i + (j-i)/2 @@ -2338,14 +2335,12 @@ func (checkOverflow) Float32(v float64) (overflow bool) { } return math.MaxFloat32 < v && v <= math.MaxFloat64 } - func (checkOverflow) Uint(v uint64, bitsize uint8) (overflow bool) { if v != 0 && v != (v<<(64-bitsize))>>(64-bitsize) { overflow = true } return } - func (checkOverflow) Int(v int64, bitsize uint8) (overflow bool) { if v != 0 && v != (v<<(64-bitsize))>>(64-bitsize) { overflow = true @@ -2358,7 +2353,7 @@ func (checkOverflow) Uint2Int(v uint64, neg bool) (overflow bool) { } func (checkOverflow) SignedInt(v uint64) (overflow bool) { - // e.g. -127 to 128 for int8 + //e.g. -127 to 128 for int8 pos := (v >> 63) == 0 ui2 := v & 0x7fffffffffffffff if pos { @@ -2379,21 +2374,18 @@ func (x checkOverflow) Float32V(v float64) float64 { } return v } - func (x checkOverflow) UintV(v uint64, bitsize uint8) uint64 { if x.Uint(v, bitsize) { halt.errorf("uint64 overflow: %v", v) } return v } - func (x checkOverflow) IntV(v int64, bitsize uint8) int64 { if x.Int(v, bitsize) { halt.errorf("int64 overflow: %v", v) } return v } - func (x checkOverflow) SignedIntV(v uint64) int64 { if x.SignedInt(v) { halt.errorf("uint64 to int64 overflow: %v", v) @@ -2478,7 +2470,6 @@ func (x *bitset32) set(pos byte) *bitset32 { x[pos&31] = true // x[pos%32] = true return x } - func (x *bitset32) isset(pos byte) bool { return x[pos&31] // x[pos%32] } @@ -2499,7 +2490,6 @@ func (x *bitset256) set(pos byte) *bitset256 { x[pos] = true return x } - func (x *bitset256) isset(pos byte) bool { return x[pos] } @@ -2584,17 +2574,14 @@ func (mustHdl) String(s string, err error) string { halt.onerror(err) return s } - func (mustHdl) Int(s int64, err error) int64 { halt.onerror(err) return s } - func (mustHdl) Uint(s uint64, err error) uint64 { halt.onerror(err) return s } - func (mustHdl) Float(s float64, err error) float64 { halt.onerror(err) return s @@ -2726,7 +2713,7 @@ func (x *bytesFreelist) checkPutGet(v []byte, length int) []byte { // assume cap(v) < length, so put must happen before get y := *x - put := cap(v) == 0 // if empty, consider it already put + var put = cap(v) == 0 // if empty, consider it already put if !put { y = append(y, v) } diff --git a/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go b/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go index d184331..d1d8aa3 100644 --- a/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go +++ b/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go @@ -246,27 +246,21 @@ func (x *atomicRtidFnSlice) store(p []codecRtidFn) { func (n *fauxUnion) ru() reflect.Value { return reflect.ValueOf(&n.u).Elem() } - func (n *fauxUnion) ri() reflect.Value { return reflect.ValueOf(&n.i).Elem() } - func (n *fauxUnion) rf() reflect.Value { return reflect.ValueOf(&n.f).Elem() } - func (n *fauxUnion) rl() reflect.Value { return reflect.ValueOf(&n.l).Elem() } - func (n *fauxUnion) rs() reflect.Value { return reflect.ValueOf(&n.s).Elem() } - func (n *fauxUnion) rt() reflect.Value { return reflect.ValueOf(&n.t).Elem() } - func (n *fauxUnion) rb() reflect.Value { return reflect.ValueOf(&n.b).Elem() } diff --git a/vendor/github.com/ugorji/go/codec/helper_unsafe.go b/vendor/github.com/ugorji/go/codec/helper_unsafe.go index c4a79a6..2efb690 100644 --- a/vendor/github.com/ugorji/go/codec/helper_unsafe.go +++ b/vendor/github.com/ugorji/go/codec/helper_unsafe.go @@ -142,7 +142,7 @@ func byteSliceSameData(v1 []byte, v2 []byte) bool { // This applies to references like map/ptr/unsafepointer/chan/func, // and non-reference values like interface/slice. func isNil(v interface{}) (rv reflect.Value, isnil bool) { - ui := (*unsafeIntf)(unsafe.Pointer(&v)) + var ui = (*unsafeIntf)(unsafe.Pointer(&v)) if ui.ptr == nil { isnil = true return @@ -364,8 +364,8 @@ func i2rtid(i interface{}) uintptr { // -------------------------- func unsafeCmpZero(ptr unsafe.Pointer, size int) bool { - s1 := unsafeString{ptr, size} - s2 := unsafeString{unsafeZeroAddr, size} + var s1 = unsafeString{ptr, size} + var s2 = unsafeString{unsafeZeroAddr, size} if size > len(unsafeZeroArr) { arr := make([]byte, size) s2.Data = unsafe.Pointer(&arr[0]) @@ -394,6 +394,7 @@ func isEmptyValue(v reflect.Value, tinfos *TypeInfos, recursive bool) bool { // return unsafeCmpZero(urv.ptr, int(rtsize(rvType(v)))) return unsafeCmpZero(urv.ptr, int(rtsize2(urv.typ))) + } func isEmptyValueFallbackRecur(urv *unsafeReflectValue, v reflect.Value, tinfos *TypeInfos) bool { @@ -568,37 +569,31 @@ func (n *fauxUnion) ru() (v reflect.Value) { ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.u) return } - func (n *fauxUnion) ri() (v reflect.Value) { v = defUnsafeDecNakedWrapper.ri ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.i) return } - func (n *fauxUnion) rf() (v reflect.Value) { v = defUnsafeDecNakedWrapper.rf ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.f) return } - func (n *fauxUnion) rl() (v reflect.Value) { v = defUnsafeDecNakedWrapper.rl ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.l) return } - func (n *fauxUnion) rs() (v reflect.Value) { v = defUnsafeDecNakedWrapper.rs ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.s) return } - func (n *fauxUnion) rt() (v reflect.Value) { v = defUnsafeDecNakedWrapper.rt ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.t) return } - func (n *fauxUnion) rb() (v reflect.Value) { v = defUnsafeDecNakedWrapper.rb ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.b) @@ -1120,8 +1115,8 @@ func unsafeMapKVPtr(urv *unsafeReflectValue) unsafe.Pointer { } func mapGet(m, k, v reflect.Value, keyFastKind mapKeyFastKind, valIsIndirect, valIsRef bool) (_ reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&k)) - kptr := unsafeMapKVPtr(urv) + var urv = (*unsafeReflectValue)(unsafe.Pointer(&k)) + var kptr = unsafeMapKVPtr(urv) urv = (*unsafeReflectValue)(unsafe.Pointer(&m)) mptr := rvRefPtr(urv) @@ -1160,11 +1155,11 @@ func mapGet(m, k, v reflect.Value, keyFastKind mapKeyFastKind, valIsIndirect, va } func mapSet(m, k, v reflect.Value, keyFastKind mapKeyFastKind, valIsIndirect, valIsRef bool) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&k)) - kptr := unsafeMapKVPtr(urv) + var urv = (*unsafeReflectValue)(unsafe.Pointer(&k)) + var kptr = unsafeMapKVPtr(urv) urv = (*unsafeReflectValue)(unsafe.Pointer(&v)) - vtyp := urv.typ - vptr := unsafeMapKVPtr(urv) + var vtyp = urv.typ + var vptr = unsafeMapKVPtr(urv) urv = (*unsafeReflectValue)(unsafe.Pointer(&m)) mptr := rvRefPtr(urv) @@ -1287,7 +1282,6 @@ func len_map(m unsafe.Pointer) int { // return maplen(m) return len_map_chan(m) } - func len_chan(m unsafe.Pointer) int { // return chanlen(m) return len_map_chan(m) diff --git a/vendor/github.com/ugorji/go/codec/json.go b/vendor/github.com/ugorji/go/codec/json.go index b137196..629a416 100644 --- a/vendor/github.com/ugorji/go/codec/json.go +++ b/vendor/github.com/ugorji/go/codec/json.go @@ -343,10 +343,10 @@ func (e *jsonEncDriver) encodeUint(neg bool, quotes bool, u uint64) { "80818283848586878889" + "90919293949596979899" - // typically, 19 or 20 bytes sufficient for decimal encoding a uint64 - // var a [24]byte - a := e.b[0:24] - i := uint8(len(a)) + // typically, 19 or 20 bytes sufficient for decimal encoding a uint64 + // var a [24]byte + var a = e.b[0:24] + var i = uint8(len(a)) if quotes { i-- @@ -354,7 +354,7 @@ func (e *jsonEncDriver) encodeUint(neg bool, quotes bool, u uint64) { } // u guaranteed to fit into a uint (as we are not 32bit OS) var is uint - us := uint(u) + var us = uint(u) for us >= 100 { is = us % 100 * 2 us /= 100 @@ -728,7 +728,7 @@ func (d *jsonDecDriver) advance() { func (d *jsonDecDriver) nextValueBytes(v0 []byte) (v []byte) { v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} v, cursor := d.nextValueBytesR(v) h.bytesRdV(&v, cursor) return @@ -736,7 +736,7 @@ func (d *jsonDecDriver) nextValueBytes(v0 []byte) (v []byte) { func (d *jsonDecDriver) nextValueBytesR(v0 []byte) (v []byte, cursor uint) { v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} dr := &d.d.decRd consumeString := func() { @@ -1378,7 +1378,7 @@ func (h *JsonHandle) typical() bool { } func (h *JsonHandle) newEncDriver() encDriver { - e := &jsonEncDriver{h: h} + var e = &jsonEncDriver{h: h} // var x []byte // e.buf = &x e.e.e = e @@ -1389,7 +1389,7 @@ func (h *JsonHandle) newEncDriver() encDriver { } func (h *JsonHandle) newDecDriver() decDriver { - d := &jsonDecDriver{h: h} + var d = &jsonDecDriver{h: h} var x []byte d.buf = &x d.d.d = d @@ -1465,10 +1465,8 @@ func jsonFloatStrconvFmtPrec32(f float32) (fmt byte, prec int8) { return } -var ( - _ decDriverContainerTracker = (*jsonDecDriver)(nil) - _ encDriverContainerTracker = (*jsonEncDriver)(nil) - _ decDriver = (*jsonDecDriver)(nil) -) +var _ decDriverContainerTracker = (*jsonDecDriver)(nil) +var _ encDriverContainerTracker = (*jsonEncDriver)(nil) +var _ decDriver = (*jsonDecDriver)(nil) var _ encDriver = (*jsonEncDriver)(nil) diff --git a/vendor/github.com/ugorji/go/codec/msgpack.go b/vendor/github.com/ugorji/go/codec/msgpack.go index 47c5f5e..75477bb 100644 --- a/vendor/github.com/ugorji/go/codec/msgpack.go +++ b/vendor/github.com/ugorji/go/codec/msgpack.go @@ -76,10 +76,8 @@ const ( mpNegFixNumMax byte = 0xff ) -var ( - mpTimeExtTag int8 = -1 - mpTimeExtTagU = uint8(mpTimeExtTag) -) +var mpTimeExtTag int8 = -1 +var mpTimeExtTagU = uint8(mpTimeExtTag) var mpdescNames = map[byte]string{ mpNil: "nil", @@ -265,7 +263,7 @@ func (e *msgpackEncDriver) EncodeTime(t time.Time) { t = t.UTC() sec, nsec := t.Unix(), uint64(t.Nanosecond()) var data64 uint64 - l := 4 + var l = 4 if sec >= 0 && sec>>34 == 0 { data64 = (nsec << 34) | uint64(sec) if data64&0xffffffff00000000 != 0 { @@ -534,8 +532,8 @@ func (d *msgpackDecDriver) nextValueBytes(v0 []byte) (v []byte) { d.readNextBd() } v = v0 - h := decNextValueBytesHelper{d: &d.d} - cursor := d.d.rb.c - 1 + var h = decNextValueBytesHelper{d: &d.d} + var cursor = d.d.rb.c - 1 h.append1(&v, d.bd) v = d.nextValueBytesBdReadR(v) d.bdRead = false @@ -546,14 +544,14 @@ func (d *msgpackDecDriver) nextValueBytes(v0 []byte) (v []byte) { func (d *msgpackDecDriver) nextValueBytesR(v0 []byte) (v []byte) { d.readNextBd() v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} h.append1(&v, d.bd) return d.nextValueBytesBdReadR(v) } func (d *msgpackDecDriver) nextValueBytesBdReadR(v0 []byte) (v []byte) { v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} bd := d.bd @@ -1032,7 +1030,7 @@ func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xbs []byte, xta //-------------------------------------------------- -// MsgpackHandle is a Handle for the Msgpack Schema-Free Encoding Format. +//MsgpackHandle is a Handle for the Msgpack Schema-Free Encoding Format. type MsgpackHandle struct { binaryEncodingType BasicHandle @@ -1064,7 +1062,7 @@ func (h *MsgpackHandle) Name() string { return "msgpack" } func (h *MsgpackHandle) desc(bd byte) string { return mpdesc(bd) } func (h *MsgpackHandle) newEncDriver() encDriver { - e := &msgpackEncDriver{h: h} + var e = &msgpackEncDriver{h: h} e.e.e = e e.e.init(h) e.reset() @@ -1143,7 +1141,7 @@ func (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint // We read the response header by hand // so that the body can be decoded on its own from the stream at a later time. - const fia byte = 0x94 // four item array descriptor value + const fia byte = 0x94 //four item array descriptor value var ba [1]byte var n int @@ -1157,7 +1155,7 @@ func (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint } } - b := ba[0] + var b = ba[0] if b != fia { err = fmt.Errorf("not array - %s %x/%s", msgBadDesc, b, mpdesc(b)) } else { @@ -1196,7 +1194,5 @@ func (x msgpackSpecRpc) ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.Clien return &msgpackSpecRpcCodec{newRPCCodec(conn, h)} } -var ( - _ decDriver = (*msgpackDecDriver)(nil) - _ encDriver = (*msgpackEncDriver)(nil) -) +var _ decDriver = (*msgpackDecDriver)(nil) +var _ encDriver = (*msgpackEncDriver)(nil) diff --git a/vendor/github.com/ugorji/go/codec/reader.go b/vendor/github.com/ugorji/go/codec/reader.go index 070ba85..d8e623a 100644 --- a/vendor/github.com/ugorji/go/codec/reader.go +++ b/vendor/github.com/ugorji/go/codec/reader.go @@ -316,7 +316,7 @@ func (z *bufioDecReader) reset(r io.Reader, bufsize int, blist *bytesFreelist) { } func (z *bufioDecReader) readb(p []byte) { - n := uint(copy(p, z.buf[z.c:])) + var n = uint(copy(p, z.buf[z.c:])) z.n += n z.c += n if len(p) != int(n) { @@ -782,7 +782,6 @@ func (z *decRd) readn1() (v uint8) { } return } - func (z *decRd) readn1IO() uint8 { if z.bufio { return z.bi.readn1() diff --git a/vendor/github.com/ugorji/go/codec/rpc.go b/vendor/github.com/ugorji/go/codec/rpc.go index 900117f..e5dd1d2 100644 --- a/vendor/github.com/ugorji/go/codec/rpc.go +++ b/vendor/github.com/ugorji/go/codec/rpc.go @@ -104,7 +104,7 @@ func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2 bool) (err error) { func (c *rpcCodec) read(obj interface{}) (err error) { err = c.ready() if err == nil { - // If nil is passed in, we should read and discard + //If nil is passed in, we should read and discard if obj == nil { // return c.dec.Decode(&obj) err = c.dec.swallowErr() diff --git a/vendor/github.com/ugorji/go/codec/simple.go b/vendor/github.com/ugorji/go/codec/simple.go index 1d1113d..a08b553 100644 --- a/vendor/github.com/ugorji/go/codec/simple.go +++ b/vendor/github.com/ugorji/go/codec/simple.go @@ -593,8 +593,8 @@ func (d *simpleDecDriver) nextValueBytes(v0 []byte) (v []byte) { d.readNextBd() } v = v0 - h := decNextValueBytesHelper{d: &d.d} - cursor := d.d.rb.c - 1 + var h = decNextValueBytesHelper{d: &d.d} + var cursor = d.d.rb.c - 1 h.append1(&v, d.bd) v = d.nextValueBytesBdReadR(v) d.bdRead = false @@ -605,14 +605,14 @@ func (d *simpleDecDriver) nextValueBytes(v0 []byte) (v []byte) { func (d *simpleDecDriver) nextValueBytesR(v0 []byte) (v []byte) { d.readNextBd() v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} h.append1(&v, d.bd) return d.nextValueBytesBdReadR(v) } func (d *simpleDecDriver) nextValueBytesBdReadR(v0 []byte) (v []byte) { v = v0 - h := decNextValueBytesHelper{d: &d.d} + var h = decNextValueBytesHelper{d: &d.d} c := d.bd @@ -724,7 +724,7 @@ func (h *SimpleHandle) Name() string { return "simple" } func (h *SimpleHandle) desc(bd byte) string { return simpledesc(bd) } func (h *SimpleHandle) newEncDriver() encDriver { - e := &simpleEncDriver{h: h} + var e = &simpleEncDriver{h: h} e.e.e = e e.e.init(h) e.reset() @@ -746,7 +746,5 @@ func (d *simpleDecDriver) reset() { d.bd, d.bdRead = 0, false } -var ( - _ decDriver = (*simpleDecDriver)(nil) - _ encDriver = (*simpleEncDriver)(nil) -) +var _ decDriver = (*simpleDecDriver)(nil) +var _ encDriver = (*simpleEncDriver)(nil) diff --git a/vendor/github.com/ugorji/go/codec/sort-slice.generated.go b/vendor/github.com/ugorji/go/codec/sort-slice.generated.go index 8cabcb1..92441eb 100644 --- a/vendor/github.com/ugorji/go/codec/sort-slice.generated.go +++ b/vendor/github.com/ugorji/go/codec/sort-slice.generated.go @@ -5,11 +5,9 @@ package codec -import ( - "time" - "reflect" - "bytes" -) +import "time" +import "reflect" +import "bytes" type stringSlice []string diff --git a/vendor/github.com/ugorji/go/codec/writer.go b/vendor/github.com/ugorji/go/codec/writer.go index 68d4025..5774ae0 100644 --- a/vendor/github.com/ugorji/go/codec/writer.go +++ b/vendor/github.com/ugorji/go/codec/writer.go @@ -128,7 +128,6 @@ func (z *bufioEncWriter) writen1(b1 byte) { z.buf[z.n] = b1 z.n++ } - func (z *bufioEncWriter) writen2(b1, b2 byte) { if 2 > len(z.buf)-z.n { z.flush() @@ -137,7 +136,6 @@ func (z *bufioEncWriter) writen2(b1, b2 byte) { z.buf[z.n] = b1 z.n += 2 } - func (z *bufioEncWriter) writen4(b [4]byte) { if 4 > len(z.buf)-z.n { z.flush() @@ -172,39 +170,31 @@ type bytesEncAppender struct { func (z *bytesEncAppender) writeb(s []byte) { z.b = append(z.b, s...) } - func (z *bytesEncAppender) writestr(s string) { z.b = append(z.b, s...) } - func (z *bytesEncAppender) writeqstr(s string) { z.b = append(append(append(z.b, '"'), s...), '"') // z.b = append(z.b, '"') // z.b = append(z.b, s...) // z.b = append(z.b, '"') } - func (z *bytesEncAppender) writen1(b1 byte) { z.b = append(z.b, b1) } - func (z *bytesEncAppender) writen2(b1, b2 byte) { z.b = append(z.b, b1, b2) } - func (z *bytesEncAppender) writen4(b [4]byte) { z.b = append(z.b, b[:]...) } - func (z *bytesEncAppender) writen8(b [8]byte) { z.b = append(z.b, b[:]...) } - func (z *bytesEncAppender) endErr() error { *(z.out) = z.b return nil } - func (z *bytesEncAppender) reset(in []byte, out *[]byte) { z.b = in[:0] z.out = out @@ -237,7 +227,6 @@ func (z *encWr) writeb(s []byte) { z.wf.writeb(s) } } - func (z *encWr) writeqstr(s string) { if z.bytes { // MARKER: z.wb.writeqstr(s) @@ -246,7 +235,6 @@ func (z *encWr) writeqstr(s string) { z.wf.writeqstr(s) } } - func (z *encWr) writestr(s string) { if z.bytes { z.wb.writestr(s) @@ -254,7 +242,6 @@ func (z *encWr) writestr(s string) { z.wf.writestr(s) } } - func (z *encWr) writen1(b1 byte) { if z.bytes { z.wb.writen1(b1) @@ -271,7 +258,6 @@ func (z *encWr) writen2(b1, b2 byte) { z.wf.writen2(b1, b2) } } - func (z *encWr) writen4(b [4]byte) { if z.bytes { z.wb.writen4(b) @@ -279,7 +265,6 @@ func (z *encWr) writen4(b [4]byte) { z.wf.writen4(b) } } - func (z *encWr) writen8(b [8]byte) { if z.bytes { z.wb.writen8(b) diff --git a/vendor/go.uber.org/zap/stacktrace.go b/vendor/go.uber.org/zap/stacktrace.go index 7c67bf6..0cf8c1d 100644 --- a/vendor/go.uber.org/zap/stacktrace.go +++ b/vendor/go.uber.org/zap/stacktrace.go @@ -27,11 +27,13 @@ import ( "go.uber.org/zap/internal/bufferpool" ) -var _stacktracePool = sync.Pool{ - New: func() interface{} { - return newProgramCounters(64) - }, -} +var ( + _stacktracePool = sync.Pool{ + New: func() interface{} { + return newProgramCounters(64) + }, + } +) func takeStacktrace(skip int) string { buffer := bufferpool.Get() diff --git a/vendor/go.uber.org/zap/zapcore/entry.go b/vendor/go.uber.org/zap/zapcore/entry.go index d813803..4aa8b4f 100644 --- a/vendor/go.uber.org/zap/zapcore/entry.go +++ b/vendor/go.uber.org/zap/zapcore/entry.go @@ -33,12 +33,14 @@ import ( "go.uber.org/multierr" ) -var _cePool = sync.Pool{New: func() interface{} { - // Pre-allocate some space for cores. - return &CheckedEntry{ - cores: make([]Core, 4), - } -}} +var ( + _cePool = sync.Pool{New: func() interface{} { + // Pre-allocate some space for cores. + return &CheckedEntry{ + cores: make([]Core, 4), + } + }} +) func getCheckedEntry() *CheckedEntry { ce := _cePool.Get().(*CheckedEntry) diff --git a/vendor/golang.org/x/crypto/ssh/certs.go b/vendor/golang.org/x/crypto/ssh/certs.go index faf5536..916c840 100644 --- a/vendor/golang.org/x/crypto/ssh/certs.go +++ b/vendor/golang.org/x/crypto/ssh/certs.go @@ -240,8 +240,7 @@ func NewCertSigner(cert *Certificate, signer Signer) (Signer, error) { if algorithmSigner, ok := signer.(AlgorithmSigner); ok { return &algorithmOpenSSHCertSigner{ - &openSSHCertSigner{cert, signer}, algorithmSigner, - }, nil + &openSSHCertSigner{cert, signer}, algorithmSigner}, nil } else { return &openSSHCertSigner{cert, signer}, nil } diff --git a/vendor/golang.org/x/crypto/ssh/channel.go b/vendor/golang.org/x/crypto/ssh/channel.go index 91ad533..c0834c0 100644 --- a/vendor/golang.org/x/crypto/ssh/channel.go +++ b/vendor/golang.org/x/crypto/ssh/channel.go @@ -472,10 +472,8 @@ func (m *mux) newChannel(chanType string, direction channelDirection, extraData return ch } -var ( - errUndecided = errors.New("ssh: must Accept or Reject channel") - errDecidedAlready = errors.New("ssh: can call Accept or Reject only once") -) +var errUndecided = errors.New("ssh: must Accept or Reject channel") +var errDecidedAlready = errors.New("ssh: can call Accept or Reject only once") type extChannel struct { code uint32 @@ -543,8 +541,7 @@ func (ch *channel) CloseWrite() error { } ch.sentEOF = true return ch.sendMessage(channelEOFMsg{ - PeersID: ch.remoteId, - }) + PeersID: ch.remoteId}) } func (ch *channel) Close() error { @@ -553,8 +550,7 @@ func (ch *channel) Close() error { } return ch.sendMessage(channelCloseMsg{ - PeersID: ch.remoteId, - }) + PeersID: ch.remoteId}) } // Extended returns an io.ReadWriter that sends and receives data on the given, diff --git a/vendor/golang.org/x/crypto/ssh/common.go b/vendor/golang.org/x/crypto/ssh/common.go index 7c4a441..290382d 100644 --- a/vendor/golang.org/x/crypto/ssh/common.go +++ b/vendor/golang.org/x/crypto/ssh/common.go @@ -139,6 +139,7 @@ func (a *directionAlgorithms) rekeyBytes() int64 { switch a.Cipher { case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcmCipherID, aes128cbcID: return 16 * (1 << 32) + } // For others, stick with RFC4253 recommendation to rekey after 1 Gb of data. diff --git a/vendor/golang.org/x/crypto/ssh/handshake.go b/vendor/golang.org/x/crypto/ssh/handshake.go index 9a2f203..2b10b05 100644 --- a/vendor/golang.org/x/crypto/ssh/handshake.go +++ b/vendor/golang.org/x/crypto/ssh/handshake.go @@ -257,6 +257,7 @@ func (t *handshakeTransport) resetWriteThresholds() { } func (t *handshakeTransport) kexLoop() { + write: for t.getWriteError() == nil { var request *pendingKex diff --git a/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go b/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go index dad2d93..af81d26 100644 --- a/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go +++ b/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go @@ -11,7 +11,6 @@ package bcrypt_pbkdf import ( "crypto/sha512" "errors" - "golang.org/x/crypto/blowfish" ) diff --git a/vendor/golang.org/x/crypto/ssh/kex.go b/vendor/golang.org/x/crypto/ssh/kex.go index d202903..766e929 100644 --- a/vendor/golang.org/x/crypto/ssh/kex.go +++ b/vendor/golang.org/x/crypto/ssh/kex.go @@ -602,14 +602,14 @@ func (gex dhGEXSHA) Client(c packetConn, randSource io.Reader, magics *handshake // Check if g is safe by verifing that g > 1 and g < p - 1 one := big.NewInt(1) - pMinusOne := &big.Int{} + var pMinusOne = &big.Int{} pMinusOne.Sub(gex.p, one) if gex.g.Cmp(one) != 1 && gex.g.Cmp(pMinusOne) != -1 { return nil, fmt.Errorf("ssh: server provided gex g is not safe") } // Send GexInit - pHalf := &big.Int{} + var pHalf = &big.Int{} pHalf.Rsh(gex.p, 1) x, err := rand.Int(randSource, pHalf) if err != nil { @@ -723,7 +723,7 @@ func (gex dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshake return } - pHalf := &big.Int{} + var pHalf = &big.Int{} pHalf.Rsh(gex.p, 1) y, err := rand.Int(randSource, pHalf) diff --git a/vendor/golang.org/x/crypto/ssh/messages.go b/vendor/golang.org/x/crypto/ssh/messages.go index e7fcbb1..ac41a41 100644 --- a/vendor/golang.org/x/crypto/ssh/messages.go +++ b/vendor/golang.org/x/crypto/ssh/messages.go @@ -152,7 +152,8 @@ type userAuthRequestMsg struct { } // Used for debug printouts of packets. -type userAuthSuccessMsg struct{} +type userAuthSuccessMsg struct { +} // See RFC 4252, section 5.1 const msgUserAuthFailure = 51 @@ -175,10 +176,8 @@ type userAuthBannerMsg struct { } // See RFC 4256, section 3.2 -const ( - msgUserAuthInfoRequest = 60 - msgUserAuthInfoResponse = 61 -) +const msgUserAuthInfoRequest = 60 +const msgUserAuthInfoResponse = 61 type userAuthInfoRequestMsg struct { User string `sshtype:"60"` @@ -199,10 +198,8 @@ type channelOpenMsg struct { TypeSpecificData []byte `ssh:"rest"` } -const ( - msgChannelExtendedData = 95 - msgChannelData = 94 -) +const msgChannelExtendedData = 95 +const msgChannelData = 94 // Used for debug print outs of packets. type channelDataMsg struct { diff --git a/vendor/golang.org/x/crypto/ssh/ssh_gss.go b/vendor/golang.org/x/crypto/ssh/ssh_gss.go index 4687b45..24bd7c8 100644 --- a/vendor/golang.org/x/crypto/ssh/ssh_gss.go +++ b/vendor/golang.org/x/crypto/ssh/ssh_gss.go @@ -87,10 +87,12 @@ type GSSAPIServer interface { DeleteSecContext() error } -// OpenSSH supports Kerberos V5 mechanism only for GSS-API authentication, -// so we also support the krb5 mechanism only. -// See RFC 1964 section 1. -var krb5Mesh = asn1.ObjectIdentifier{1, 2, 840, 113554, 1, 2, 2} +var ( + // OpenSSH supports Kerberos V5 mechanism only for GSS-API authentication, + // so we also support the krb5 mechanism only. + // See RFC 1964 section 1. + krb5Mesh = asn1.ObjectIdentifier{1, 2, 840, 113554, 1, 2, 2} +) // The GSS-API authentication method is initiated when the client sends an SSH_MSG_USERAUTH_REQUEST // See RFC 4462 section 3.2. diff --git a/vendor/golang.org/x/sys/cpu/byteorder.go b/vendor/golang.org/x/sys/cpu/byteorder.go index 3365c0e..dcbb14e 100644 --- a/vendor/golang.org/x/sys/cpu/byteorder.go +++ b/vendor/golang.org/x/sys/cpu/byteorder.go @@ -14,10 +14,8 @@ type byteOrder interface { Uint64([]byte) uint64 } -type ( - littleEndian struct{} - bigEndian struct{} -) +type littleEndian struct{} +type bigEndian struct{} func (littleEndian) Uint32(b []byte) uint32 { _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808 diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm.go b/vendor/golang.org/x/sys/cpu/cpu_arm.go index 855beac..301b752 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm.go +++ b/vendor/golang.org/x/sys/cpu/cpu_arm.go @@ -69,4 +69,5 @@ func initOptions() { {Name: "aes", Feature: &ARM.HasAES}, {Name: "crc32", Feature: &ARM.HasCRC32}, } + } diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.go b/vendor/golang.org/x/sys/cpu/cpu_x86.go index d32800a..fd380c0 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_x86.go +++ b/vendor/golang.org/x/sys/cpu/cpu_x86.go @@ -57,6 +57,7 @@ func initOptions() { } func archInit() { + Initialized = true maxID, _, _, _ := cpuid(0, 0) diff --git a/vendor/golang.org/x/sys/cpu/hwcap_linux.go b/vendor/golang.org/x/sys/cpu/hwcap_linux.go index b053a88..f3baa37 100644 --- a/vendor/golang.org/x/sys/cpu/hwcap_linux.go +++ b/vendor/golang.org/x/sys/cpu/hwcap_linux.go @@ -20,10 +20,8 @@ const ( // For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2 // These are initialized in cpu_$GOARCH.go // and should not be changed after they are initialized. -var ( - hwCap uint - hwCap2 uint -) +var hwCap uint +var hwCap2 uint func readHWCAP() error { buf, err := ioutil.ReadFile(procAuxv) diff --git a/vendor/golang.org/x/sys/unix/aliases.go b/vendor/golang.org/x/sys/unix/aliases.go index 21b3752..abc89c1 100644 --- a/vendor/golang.org/x/sys/unix/aliases.go +++ b/vendor/golang.org/x/sys/unix/aliases.go @@ -10,8 +10,6 @@ package unix import "syscall" -type ( - Signal = syscall.Signal - Errno = syscall.Errno - SysProcAttr = syscall.SysProcAttr -) +type Signal = syscall.Signal +type Errno = syscall.Errno +type SysProcAttr = syscall.SysProcAttr diff --git a/vendor/golang.org/x/sys/unix/cap_freebsd.go b/vendor/golang.org/x/sys/unix/cap_freebsd.go index eec747c..0b7c6ad 100644 --- a/vendor/golang.org/x/sys/unix/cap_freebsd.go +++ b/vendor/golang.org/x/sys/unix/cap_freebsd.go @@ -21,10 +21,12 @@ const ( capArSizeMax = capRightsGoVersion + 2 ) -var bit2idx = []int{ - -1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, - 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -} +var ( + bit2idx = []int{ + -1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, + 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + } +) func capidxbit(right uint64) int { return int((right >> 57) & 0x1f) diff --git a/vendor/golang.org/x/sys/unix/epoll_zos.go b/vendor/golang.org/x/sys/unix/epoll_zos.go index 37ed2ea..cedaf7e 100644 --- a/vendor/golang.org/x/sys/unix/epoll_zos.go +++ b/vendor/golang.org/x/sys/unix/epoll_zos.go @@ -51,7 +51,7 @@ const ( // epToPollEvt converts epoll event field to poll equivalent. // In epoll, Events is a 32-bit field, while poll uses 16 bits. func epToPollEvt(events uint32) int16 { - ep2p := map[uint32]int16{ + var ep2p = map[uint32]int16{ EPOLLIN: POLLIN, EPOLLOUT: POLLOUT, EPOLLHUP: POLLHUP, @@ -71,7 +71,7 @@ func epToPollEvt(events uint32) int16 { // pToEpollEvt converts 16 bit poll event bitfields to 32-bit epoll event fields. func pToEpollEvt(revents int16) uint32 { - p2ep := map[int16]uint32{ + var p2ep = map[int16]uint32{ POLLIN: EPOLLIN, POLLOUT: EPOLLOUT, POLLHUP: EPOLLHUP, @@ -131,6 +131,7 @@ func (e *epollImpl) epollctl(epfd int, op int, fd int, event *EpollEvent) (err e ep, ok := e.epfd2ep[epfd] if !ok { + return EBADF } diff --git a/vendor/golang.org/x/sys/unix/fstatfs_zos.go b/vendor/golang.org/x/sys/unix/fstatfs_zos.go index 96cdaa8..e377cc9 100644 --- a/vendor/golang.org/x/sys/unix/fstatfs_zos.go +++ b/vendor/golang.org/x/sys/unix/fstatfs_zos.go @@ -49,7 +49,7 @@ func Fstatfs(fd int, stat *Statfs_t) (err error) { default: break } - // proceed to return if: err is nil (found), err is nonnil but not ERANGE (another error occurred) + //proceed to return if: err is nil (found), err is nonnil but not ERANGE (another error occurred) if err == nil || err != nil && err != ERANGE { break } @@ -68,7 +68,7 @@ func tryGetmntent64(stat *Statfs_t) (err error) { if err != nil { return err } - err = ERANGE // return ERANGE if no match is found in this batch + err = ERANGE //return ERANGE if no match is found in this batch for i := 0; i < fs_count; i++ { if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) @@ -89,7 +89,7 @@ func tryGetmntent128(stat *Statfs_t) (err error) { if err != nil { return err } - err = ERANGE // return ERANGE if no match is found in this batch + err = ERANGE //return ERANGE if no match is found in this batch for i := 0; i < fs_count; i++ { if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) @@ -110,7 +110,7 @@ func tryGetmntent256(stat *Statfs_t) (err error) { if err != nil { return err } - err = ERANGE // return ERANGE if no match is found in this batch + err = ERANGE //return ERANGE if no match is found in this batch for i := 0; i < fs_count; i++ { if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) @@ -131,7 +131,7 @@ func tryGetmntent512(stat *Statfs_t) (err error) { if err != nil { return err } - err = ERANGE // return ERANGE if no match is found in this batch + err = ERANGE //return ERANGE if no match is found in this batch for i := 0; i < fs_count; i++ { if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) @@ -152,7 +152,7 @@ func tryGetmntent1024(stat *Statfs_t) (err error) { if err != nil { return err } - err = ERANGE // return ERANGE if no match is found in this batch + err = ERANGE //return ERANGE if no match is found in this batch for i := 0; i < fs_count; i++ { if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go index 1c27e2c..2a4ba47 100644 --- a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go +++ b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go @@ -15,6 +15,6 @@ func ReadDirent(fd int, buf []byte) (n int, err error) { // 64 bits should be enough. (32 bits isn't even on 386). Since the // actual system call is getdirentries64, 64 is a good guess. // TODO(rsc): Can we use a single global basep for all calls? - base := (*uintptr)(unsafe.Pointer(new(uint64))) + var base = (*uintptr)(unsafe.Pointer(new(uint64))) return Getdirentries(fd, buf, base) } diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 814d393..1223d7a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -372,7 +372,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } - length := int64(count) + var length = int64(count) err = sendfile(infd, outfd, *offset, &length, nil, 0) written = int(length) return diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go index 90ab7cd..7b52e5d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go @@ -101,10 +101,8 @@ type rlimit32 struct { //sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT -const ( - rlimInf32 = ^uint32(0) - rlimInf64 = ^uint64(0) -) +const rlimInf32 = ^uint32(0) +const rlimInf64 = ^uint64(0) func Getrlimit(resource int, rlim *Rlimit) (err error) { err = prlimit(0, resource, nil, rlim) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go index 3f4309f..6887772 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -180,10 +180,8 @@ type rlimit32 struct { //sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_UGETRLIMIT -const ( - rlimInf32 = ^uint32(0) - rlimInf64 = ^uint64(0) -) +const rlimInf32 = ^uint32(0) +const rlimInf64 = ^uint64(0) func Getrlimit(resource int, rlim *Rlimit) (err error) { err = prlimit(0, resource, nil, rlim) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go index 0384051..8f0d0a5 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -146,10 +146,8 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6 return mmap2(addr, length, prot, flags, fd, page) } -const ( - rlimInf32 = ^uint32(0) - rlimInf64 = ^uint64(0) -) +const rlimInf32 = ^uint32(0) +const rlimInf64 = ^uint64(0) type rlimit32 struct { Cur uint32 diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index 79fa0e4..a7618ce 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -326,7 +326,7 @@ func SetsockoptByte(fd, level, opt int, value byte) (err error) { } func SetsockoptInt(fd, level, opt int, value int) (err error) { - n := int32(value) + var n = int32(value) return setsockopt(fd, level, opt, unsafe.Pointer(&n), 4) } diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go index 7c7d799..f6f707a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go @@ -14,15 +14,12 @@ import "syscall" func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.Syscall(trap, a1, a2, a3) } - func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) } - func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.RawSyscall(trap, a1, a2, a3) } - func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) } diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go index dab667a..13f58d2 100644 --- a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go @@ -38,11 +38,11 @@ func copyStat(stat *Stat_t, statLE *Stat_LE_t) { stat.Rdev = uint64(statLE.Rdev) stat.Size = statLE.Size stat.Atim.Sec = int64(statLE.Atim) - stat.Atim.Nsec = 0 // zos doesn't return nanoseconds + stat.Atim.Nsec = 0 //zos doesn't return nanoseconds stat.Mtim.Sec = int64(statLE.Mtim) - stat.Mtim.Nsec = 0 // zos doesn't return nanoseconds + stat.Mtim.Nsec = 0 //zos doesn't return nanoseconds stat.Ctim.Sec = int64(statLE.Ctim) - stat.Ctim.Nsec = 0 // zos doesn't return nanoseconds + stat.Ctim.Nsec = 0 //zos doesn't return nanoseconds stat.Blksize = int64(statLE.Blksize) stat.Blocks = statLE.Blocks } @@ -321,7 +321,7 @@ func Getpgrp() (pid int) { func Getrusage(who int, rusage *Rusage) (err error) { var ruz rusage_zos err = getrusage(who, &ruz) - // Only the first two fields of Rusage are set + //Only the first two fields of Rusage are set rusage.Utime.Sec = ruz.Utime.Sec rusage.Utime.Usec = int64(ruz.Utime.Usec) rusage.Stime.Sec = ruz.Stime.Sec @@ -571,7 +571,7 @@ func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } -func setTimeval(sec, usec int64) Timeval { // fix +func setTimeval(sec, usec int64) Timeval { //fix return Timeval{Sec: sec, Usec: usec} } @@ -1219,7 +1219,7 @@ func Readdir(dir uintptr) (*Dirent, error) { // Therefore to avoid false positives we clear errno before calling it. // TODO(neeilan): Commented this out to get sys/unix compiling on z/OS. Uncomment and fix. Error: "undefined: clearsyscall" - // clearsyscall.Errno() // TODO(mundaym): check pre-emption rules. + //clearsyscall.Errno() // TODO(mundaym): check pre-emption rules. e, _, _ := syscall_syscall(SYS___READDIR_R_A, dir, uintptr(unsafe.Pointer(&ent)), uintptr(unsafe.Pointer(&res))) var err error @@ -1276,6 +1276,7 @@ func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { } func Flock(fd int, how int) error { + var flock_type int16 var fcntl_cmd int @@ -1348,7 +1349,8 @@ func Munlockall() (err error) { } func ClockGettime(clockid int32, ts *Timespec) error { - var ticks_per_sec uint32 = 100 // TODO(kenan): value is currently hardcoded; need sysconf() call otherwise + + var ticks_per_sec uint32 = 100 //TODO(kenan): value is currently hardcoded; need sysconf() call otherwise var nsec_per_sec int64 = 1000000000 if ts == nil { @@ -1481,7 +1483,7 @@ func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (d } // Slice memory layout - sl := struct { + var sl = struct { addr uintptr len int cap int @@ -1693,7 +1695,7 @@ func SetsockoptByte(fd, level, opt int, value byte) (err error) { } func SetsockoptInt(fd, level, opt int, value int) (err error) { - n := int32(value) + var n = int32(value) return setsockopt(fd, level, opt, unsafe.Pointer(&n), 4) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go index 8552191..91a23cc 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go @@ -130,7 +130,6 @@ uintptr_t mmap(uintptr_t, uintptr_t, int, int, int, long long); */ import "C" - import ( "unsafe" ) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go index 89357f9..8b737fa 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go @@ -248,7 +248,8 @@ import ( type syscallFunc uintptr -var libc_utimes, +var ( + libc_utimes, libc_utimensat, libc_getcwd, libc_accept, @@ -365,6 +366,7 @@ var libc_utimes, libc_setrlimit, libc_lseek, libc_mmap64 syscallFunc +) // Implemented in runtime/syscall_aix.go. func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go index 264df75..3c26091 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go @@ -129,7 +129,6 @@ uintptr_t mmap64(uintptr_t, uintptr_t, int, int, int, long long); */ import "C" - import ( "syscall" ) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go index 681127d..af5cb06 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go @@ -26,13 +26,15 @@ import ( //go:linkname procputmsg libc_putmsg //go:linkname procgetmsg libc_getmsg -var procreadv, +var ( + procreadv, procpreadv, procwritev, procpwritev, procaccept4, procputmsg, procgetmsg syscallFunc +) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index d6a7d42..4e18d5c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -273,7 +273,8 @@ import ( //go:linkname procsetsockopt libc_setsockopt //go:linkname procrecvfrom libc_recvfrom -var procpipe, +var ( + procpipe, procpipe2, procgetsockname, procGetcwd, @@ -403,6 +404,7 @@ var procpipe, procgetpeername, procsetsockopt, procrecvfrom syscallFunc +) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT diff --git a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go index b9384dd..7a8161c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go @@ -22,11 +22,9 @@ type ( _C_long_long int64 ) -type ( - off64 int64 - off int32 - Mode_t uint32 -) +type off64 int64 +type off int32 +type Mode_t uint32 type Timespec struct { Sec int32 @@ -328,7 +326,6 @@ type Flock_t struct { type Fsid_t struct { Val [2]uint32 } - type Fsid64_t struct { Val [2]uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go index 0760944..07ed733 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go @@ -22,11 +22,9 @@ type ( _C_long_long int64 ) -type ( - off64 int64 - off int64 - Mode_t uint32 -) +type off64 int64 +type off int64 +type Mode_t uint32 type Timespec struct { Sec int64 @@ -331,7 +329,6 @@ type Flock_t struct { type Fsid_t struct { Val [2]uint32 } - type Fsid64_t struct { Val [2]uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go index 074a0c6..8bffde7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go @@ -49,13 +49,13 @@ type Timeval struct { Usec int64 } -type timeval_zos struct { // correct (with padding and all) +type timeval_zos struct { //correct (with padding and all) Sec int64 _ [4]byte // pad Usec int32 } -type Tms struct { // clock_t is 4-byte unsigned int in zos +type Tms struct { //clock_t is 4-byte unsigned int in zos Utime uint32 Stime uint32 Cutime uint32 @@ -240,7 +240,7 @@ type PollFd struct { Revents int16 } -type Stat_t struct { // Linux Definition +type Stat_t struct { //Linux Definition Dev uint64 Ino uint64 Nlink uint64 @@ -374,7 +374,7 @@ type Winsize struct { type W_Mnth struct { Hid [4]byte Size int32 - Cur1 int32 // 32bit pointer + Cur1 int32 //32bit pointer Cur2 int32 //^ Devno uint32 _ [4]byte diff --git a/vendor/golang.org/x/sys/windows/aliases.go b/vendor/golang.org/x/sys/windows/aliases.go index 6e7dd77..af3af60 100644 --- a/vendor/golang.org/x/sys/windows/aliases.go +++ b/vendor/golang.org/x/sys/windows/aliases.go @@ -9,7 +9,5 @@ package windows import "syscall" -type ( - Errno = syscall.Errno - SysProcAttr = syscall.SysProcAttr -) +type Errno = syscall.Errno +type SysProcAttr = syscall.SysProcAttr diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 2dfe66d..0e428ec 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -1093,15 +1093,12 @@ type TrusteeValue uintptr func TrusteeValueFromString(str string) TrusteeValue { return TrusteeValue(unsafe.Pointer(StringToUTF16Ptr(str))) } - func TrusteeValueFromSID(sid *SID) TrusteeValue { return TrusteeValue(unsafe.Pointer(sid)) } - func TrusteeValueFromObjectsAndSid(objectsAndSid *OBJECTS_AND_SID) TrusteeValue { return TrusteeValue(unsafe.Pointer(objectsAndSid)) } - func TrusteeValueFromObjectsAndName(objectsAndName *OBJECTS_AND_NAME) TrusteeValue { return TrusteeValue(unsafe.Pointer(objectsAndName)) } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 1e0eea9..bb6aaf8 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -19,10 +19,8 @@ import ( "golang.org/x/sys/internal/unsafeheader" ) -type ( - Handle uintptr - HWND uintptr -) +type Handle uintptr +type HWND uintptr const ( InvalidHandle = ^Handle(0) @@ -1280,11 +1278,9 @@ func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4) } - func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq))) } - func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return syscall.EWINDOWS } diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index a50db81..23fe18e 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -1286,11 +1286,9 @@ type IpAddrString struct { Context uint32 } -const ( - MAX_ADAPTER_NAME_LENGTH = 256 - MAX_ADAPTER_DESCRIPTION_LENGTH = 128 - MAX_ADAPTER_ADDRESS_LENGTH = 8 -) +const MAX_ADAPTER_NAME_LENGTH = 256 +const MAX_ADAPTER_DESCRIPTION_LENGTH = 128 +const MAX_ADAPTER_ADDRESS_LENGTH = 8 type IpAdapterInfo struct { Next *IpAdapterInfo @@ -1313,11 +1311,9 @@ type IpAdapterInfo struct { LeaseExpires int64 } -const ( - MAXLEN_PHYSADDR = 8 - MAX_INTERFACE_NAME_LEN = 256 - MAXLEN_IFDESCR = 256 -) +const MAXLEN_PHYSADDR = 8 +const MAX_INTERFACE_NAME_LEN = 256 +const MAXLEN_IFDESCR = 256 type MibIfRow struct { Name [MAX_INTERFACE_NAME_LEN]uint16 @@ -1381,20 +1377,18 @@ type DataBlob struct { Size uint32 Data *byte } -type ( - CryptIntegerBlob DataBlob - CryptUintBlob DataBlob - CryptObjidBlob DataBlob - CertNameBlob DataBlob - CertRdnValueBlob DataBlob - CertBlob DataBlob - CrlBlob DataBlob - CryptDataBlob DataBlob - CryptHashBlob DataBlob - CryptDigestBlob DataBlob - CryptDerBlob DataBlob - CryptAttrBlob DataBlob -) +type CryptIntegerBlob DataBlob +type CryptUintBlob DataBlob +type CryptObjidBlob DataBlob +type CertNameBlob DataBlob +type CertRdnValueBlob DataBlob +type CertBlob DataBlob +type CrlBlob DataBlob +type CryptDataBlob DataBlob +type CryptHashBlob DataBlob +type CryptDigestBlob DataBlob +type CryptDerBlob DataBlob +type CryptAttrBlob DataBlob type CryptBitBlob struct { Size uint32 @@ -1421,7 +1415,8 @@ type CertChainContext struct { RevocationFreshnessTime uint32 } -type CertTrustListInfo struct { // Not implemented +type CertTrustListInfo struct { + // Not implemented } type CertSimpleChain struct { @@ -1444,7 +1439,8 @@ type CertChainElement struct { ExtendedErrorInfo *uint16 } -type CertRevocationCrlInfo struct { // Not implemented +type CertRevocationCrlInfo struct { + // Not implemented } type CertRevocationInfo struct { @@ -1514,7 +1510,8 @@ type CertPoliciesInfo struct { PolicyInfos *CertPolicyInfo } -type CertPolicyQualifierInfo struct { // Not implemented +type CertPolicyQualifierInfo struct { + // Not implemented } type CertStrongSignPara struct { diff --git a/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go index 430239a..26fbd55 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go @@ -6709,10 +6709,8 @@ var nfkcSparseValues = [869]valueRange{ } // recompMap: 7520 bytes (entries only) -var ( - recompMap map[uint32]rune - recompMapOnce sync.Once -) +var recompMap map[uint32]rune +var recompMapOnce sync.Once const recompMapPacked = "" + "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 diff --git a/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go index 39a70e4..2c58f09 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go @@ -6745,10 +6745,8 @@ var nfkcSparseValues = [871]valueRange{ } // recompMap: 7520 bytes (entries only) -var ( - recompMap map[uint32]rune - recompMapOnce sync.Once -) +var recompMap map[uint32]rune +var recompMapOnce sync.Once const recompMapPacked = "" + "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 diff --git a/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go index a750d67..7e1ae09 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go @@ -6762,10 +6762,8 @@ var nfkcSparseValues = [877]valueRange{ } // recompMap: 7520 bytes (entries only) -var ( - recompMap map[uint32]rune - recompMapOnce sync.Once -) +var recompMap map[uint32]rune +var recompMapOnce sync.Once const recompMapPacked = "" + "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 diff --git a/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go index 6e52c4a..9ea1b42 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go @@ -6811,10 +6811,8 @@ var nfkcSparseValues = [895]valueRange{ } // recompMap: 7528 bytes (entries only) -var ( - recompMap map[uint32]rune - recompMapOnce sync.Once -) +var recompMap map[uint32]rune +var recompMapOnce sync.Once const recompMapPacked = "" + "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 diff --git a/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go index b3149a6..9429069 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go @@ -6689,10 +6689,8 @@ var nfkcSparseValues = [875]valueRange{ } // recompMap: 7520 bytes (entries only) -var ( - recompMap map[uint32]rune - recompMapOnce sync.Once -) +var recompMap map[uint32]rune +var recompMapOnce sync.Once const recompMapPacked = "" + "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/encode.go b/vendor/google.golang.org/protobuf/encoding/prototext/encode.go index 299bb33..dece229 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/encode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/encode.go @@ -102,7 +102,7 @@ func (o MarshalOptions) Format(m proto.Message) string { // MarshalOptions object. Do not depend on the output being stable. It may // change over time across different versions of the program. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { - delims := [2]byte{'{', '}'} + var delims = [2]byte{'{', '}'} if o.Multiline && o.Indent == "" { o.Indent = defaultIndent diff --git a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go index 22b19cb..e7af0fe 100644 --- a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +++ b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go @@ -25,7 +25,6 @@ type list interface { func FormatList(s fmt.State, r rune, vs list) { io.WriteString(s, formatListOpt(vs, true, r == 'v' && (s.Flag('+') || s.Flag('#')))) } - func formatListOpt(vs list, isRoot, allowMulti bool) string { start, end := "[", "]" if isRoot { @@ -118,7 +117,6 @@ var descriptorAccessors = map[reflect.Type][]string{ func FormatDesc(s fmt.State, r rune, t pref.Descriptor) { io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#')))) } - func formatDescOpt(t pref.Descriptor, isRoot, allowMulti bool) string { rv := reflect.ValueOf(t) rt := rv.MethodByName("ProtoType").Type().In(0) diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go index e8de9d0..2540bef 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go @@ -148,7 +148,6 @@ func (ed *Enum) Options() pref.ProtoMessage { } return descopts.Enum } - func (ed *Enum) Values() pref.EnumValueDescriptors { if ed.L1.eagerValues { return &ed.L2.Values @@ -282,11 +281,9 @@ func (fd *Field) JSONName() string { return fd.L1.JSONName.get(fd) func (fd *Field) HasPresence() bool { return fd.L1.Cardinality != pref.Repeated && (fd.L0.ParentFile.L1.Syntax == pref.Proto2 || fd.L1.Message != nil || fd.L1.ContainingOneof != nil) } - func (fd *Field) HasOptionalKeyword() bool { return (fd.L0.ParentFile.L1.Syntax == pref.Proto2 && fd.L1.Cardinality == pref.Optional && fd.L1.ContainingOneof == nil) || fd.L1.IsProto3Optional } - func (fd *Field) IsPacked() bool { if !fd.L1.HasPacked && fd.L0.ParentFile.L1.Syntax != pref.Proto2 && fd.L1.Cardinality == pref.Repeated { switch fd.L1.Kind { @@ -307,7 +304,6 @@ func (fd *Field) MapKey() pref.FieldDescriptor { } return fd.Message().Fields().ByNumber(1) } - func (fd *Field) MapValue() pref.FieldDescriptor { if !fd.IsMap() { return nil @@ -321,11 +317,9 @@ func (fd *Field) ContainingOneof() pref.OneofDescriptor { return fd.L1.Cont func (fd *Field) ContainingMessage() pref.MessageDescriptor { return fd.L0.Parent.(pref.MessageDescriptor) } - func (fd *Field) Enum() pref.EnumDescriptor { return fd.L1.Enum } - func (fd *Field) Message() pref.MessageDescriptor { if fd.L1.IsWeak { if d, _ := protoregistry.GlobalFiles.FindDescriptorByName(fd.L1.Message.FullName()); d != nil { @@ -354,7 +348,6 @@ func (fd *Field) EnforceUTF8() bool { func (od *Oneof) IsSynthetic() bool { return od.L0.ParentFile.L1.Syntax == pref.Proto3 && len(od.L1.Fields.List) == 1 && od.L1.Fields.List[0].HasOptionalKeyword() } - func (od *Oneof) Options() pref.ProtoMessage { if f := od.L1.Options; f != nil { return f() diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go index dce672f..c0cddf8 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go @@ -58,21 +58,18 @@ func (fd *File) allocEnums(n int) []Enum { fd.allEnums = fd.allEnums[:total+n] return es } - func (fd *File) allocMessages(n int) []Message { total := len(fd.allMessages) ms := fd.allMessages[total : total+n] fd.allMessages = fd.allMessages[:total+n] return ms } - func (fd *File) allocExtensions(n int) []Extension { total := len(fd.allExtensions) xs := fd.allExtensions[total : total+n] fd.allExtensions = fd.allExtensions[:total+n] return xs } - func (fd *File) allocServices(n int) []Service { total := len(fd.allServices) xs := fd.allServices[total : total+n] @@ -456,7 +453,6 @@ var nameBuilderPool = sync.Pool{ func getBuilder() *strs.Builder { return nameBuilderPool.Get().(*strs.Builder) } - func putBuilder(b *strs.Builder) { nameBuilderPool.Put(b) } diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go index 7dbfb1f..6a8825e 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go @@ -24,18 +24,15 @@ type Enums struct { func (p *Enums) Len() int { return len(p.List) } - func (p *Enums) Get(i int) protoreflect.EnumDescriptor { return &p.List[i] } - func (p *Enums) ByName(s protoreflect.Name) protoreflect.EnumDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } - func (p *Enums) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } @@ -65,25 +62,21 @@ type EnumValues struct { func (p *EnumValues) Len() int { return len(p.List) } - func (p *EnumValues) Get(i int) protoreflect.EnumValueDescriptor { return &p.List[i] } - func (p *EnumValues) ByName(s protoreflect.Name) protoreflect.EnumValueDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } - func (p *EnumValues) ByNumber(n protoreflect.EnumNumber) protoreflect.EnumValueDescriptor { if d := p.lazyInit().byNum[n]; d != nil { return d } return nil } - func (p *EnumValues) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } @@ -116,18 +109,15 @@ type Messages struct { func (p *Messages) Len() int { return len(p.List) } - func (p *Messages) Get(i int) protoreflect.MessageDescriptor { return &p.List[i] } - func (p *Messages) ByName(s protoreflect.Name) protoreflect.MessageDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } - func (p *Messages) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } @@ -158,32 +148,27 @@ type Fields struct { func (p *Fields) Len() int { return len(p.List) } - func (p *Fields) Get(i int) protoreflect.FieldDescriptor { return &p.List[i] } - func (p *Fields) ByName(s protoreflect.Name) protoreflect.FieldDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } - func (p *Fields) ByJSONName(s string) protoreflect.FieldDescriptor { if d := p.lazyInit().byJSON[s]; d != nil { return d } return nil } - func (p *Fields) ByNumber(n protoreflect.FieldNumber) protoreflect.FieldDescriptor { if d := p.lazyInit().byNum[n]; d != nil { return d } return nil } - func (p *Fields) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } @@ -220,18 +205,15 @@ type Oneofs struct { func (p *Oneofs) Len() int { return len(p.List) } - func (p *Oneofs) Get(i int) protoreflect.OneofDescriptor { return &p.List[i] } - func (p *Oneofs) ByName(s protoreflect.Name) protoreflect.OneofDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } - func (p *Oneofs) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } @@ -260,18 +242,15 @@ type Extensions struct { func (p *Extensions) Len() int { return len(p.List) } - func (p *Extensions) Get(i int) protoreflect.ExtensionDescriptor { return &p.List[i] } - func (p *Extensions) ByName(s protoreflect.Name) protoreflect.ExtensionDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } - func (p *Extensions) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } @@ -300,18 +279,15 @@ type Services struct { func (p *Services) Len() int { return len(p.List) } - func (p *Services) Get(i int) protoreflect.ServiceDescriptor { return &p.List[i] } - func (p *Services) ByName(s protoreflect.Name) protoreflect.ServiceDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } - func (p *Services) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } @@ -340,18 +316,15 @@ type Methods struct { func (p *Methods) Len() int { return len(p.List) } - func (p *Methods) Get(i int) protoreflect.MethodDescriptor { return &p.List[i] } - func (p *Methods) ByName(s protoreflect.Name) protoreflect.MethodDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } - func (p *Methods) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go b/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go index 5a9e9a4..ff198d0 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go @@ -3022,6 +3022,7 @@ var coderUint64PackedSliceValue = valueCoderFuncs{ // sizeSfixed32 returns the size of wire encoding a int32 pointer as a Sfixed32. func sizeSfixed32(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) { + return f.tagsize + protowire.SizeFixed32() } @@ -3337,6 +3338,7 @@ var coderSfixed32PackedSliceValue = valueCoderFuncs{ // sizeFixed32 returns the size of wire encoding a uint32 pointer as a Fixed32. func sizeFixed32(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) { + return f.tagsize + protowire.SizeFixed32() } @@ -3652,6 +3654,7 @@ var coderFixed32PackedSliceValue = valueCoderFuncs{ // sizeFloat returns the size of wire encoding a float32 pointer as a Float. func sizeFloat(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) { + return f.tagsize + protowire.SizeFixed32() } @@ -3967,6 +3970,7 @@ var coderFloatPackedSliceValue = valueCoderFuncs{ // sizeSfixed64 returns the size of wire encoding a int64 pointer as a Sfixed64. func sizeSfixed64(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) { + return f.tagsize + protowire.SizeFixed64() } @@ -4282,6 +4286,7 @@ var coderSfixed64PackedSliceValue = valueCoderFuncs{ // sizeFixed64 returns the size of wire encoding a uint64 pointer as a Fixed64. func sizeFixed64(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) { + return f.tagsize + protowire.SizeFixed64() } @@ -4597,6 +4602,7 @@ var coderFixed64PackedSliceValue = valueCoderFuncs{ // sizeDouble returns the size of wire encoding a float64 pointer as a Double. func sizeDouble(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) { + return f.tagsize + protowire.SizeFixed64() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/convert.go b/vendor/google.golang.org/protobuf/internal/impl/convert.go index f83209f..36a90df 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/convert.go +++ b/vendor/google.golang.org/protobuf/internal/impl/convert.go @@ -154,16 +154,13 @@ func (c *boolConverter) PBValueOf(v reflect.Value) pref.Value { } return pref.ValueOfBool(v.Bool()) } - func (c *boolConverter) GoValueOf(v pref.Value) reflect.Value { return reflect.ValueOf(v.Bool()).Convert(c.goType) } - func (c *boolConverter) IsValidPB(v pref.Value) bool { _, ok := v.Interface().(bool) return ok } - func (c *boolConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } @@ -181,16 +178,13 @@ func (c *int32Converter) PBValueOf(v reflect.Value) pref.Value { } return pref.ValueOfInt32(int32(v.Int())) } - func (c *int32Converter) GoValueOf(v pref.Value) reflect.Value { return reflect.ValueOf(int32(v.Int())).Convert(c.goType) } - func (c *int32Converter) IsValidPB(v pref.Value) bool { _, ok := v.Interface().(int32) return ok } - func (c *int32Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } @@ -208,16 +202,13 @@ func (c *int64Converter) PBValueOf(v reflect.Value) pref.Value { } return pref.ValueOfInt64(int64(v.Int())) } - func (c *int64Converter) GoValueOf(v pref.Value) reflect.Value { return reflect.ValueOf(int64(v.Int())).Convert(c.goType) } - func (c *int64Converter) IsValidPB(v pref.Value) bool { _, ok := v.Interface().(int64) return ok } - func (c *int64Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } @@ -235,16 +226,13 @@ func (c *uint32Converter) PBValueOf(v reflect.Value) pref.Value { } return pref.ValueOfUint32(uint32(v.Uint())) } - func (c *uint32Converter) GoValueOf(v pref.Value) reflect.Value { return reflect.ValueOf(uint32(v.Uint())).Convert(c.goType) } - func (c *uint32Converter) IsValidPB(v pref.Value) bool { _, ok := v.Interface().(uint32) return ok } - func (c *uint32Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } @@ -262,16 +250,13 @@ func (c *uint64Converter) PBValueOf(v reflect.Value) pref.Value { } return pref.ValueOfUint64(uint64(v.Uint())) } - func (c *uint64Converter) GoValueOf(v pref.Value) reflect.Value { return reflect.ValueOf(uint64(v.Uint())).Convert(c.goType) } - func (c *uint64Converter) IsValidPB(v pref.Value) bool { _, ok := v.Interface().(uint64) return ok } - func (c *uint64Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } @@ -289,16 +274,13 @@ func (c *float32Converter) PBValueOf(v reflect.Value) pref.Value { } return pref.ValueOfFloat32(float32(v.Float())) } - func (c *float32Converter) GoValueOf(v pref.Value) reflect.Value { return reflect.ValueOf(float32(v.Float())).Convert(c.goType) } - func (c *float32Converter) IsValidPB(v pref.Value) bool { _, ok := v.Interface().(float32) return ok } - func (c *float32Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } @@ -316,16 +298,13 @@ func (c *float64Converter) PBValueOf(v reflect.Value) pref.Value { } return pref.ValueOfFloat64(float64(v.Float())) } - func (c *float64Converter) GoValueOf(v pref.Value) reflect.Value { return reflect.ValueOf(float64(v.Float())).Convert(c.goType) } - func (c *float64Converter) IsValidPB(v pref.Value) bool { _, ok := v.Interface().(float64) return ok } - func (c *float64Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } @@ -343,7 +322,6 @@ func (c *stringConverter) PBValueOf(v reflect.Value) pref.Value { } return pref.ValueOfString(v.Convert(stringType).String()) } - func (c *stringConverter) GoValueOf(v pref.Value) reflect.Value { // pref.Value.String never panics, so we go through an interface // conversion here to check the type. @@ -353,12 +331,10 @@ func (c *stringConverter) GoValueOf(v pref.Value) reflect.Value { } return reflect.ValueOf(s).Convert(c.goType) } - func (c *stringConverter) IsValidPB(v pref.Value) bool { _, ok := v.Interface().(string) return ok } - func (c *stringConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } @@ -379,16 +355,13 @@ func (c *bytesConverter) PBValueOf(v reflect.Value) pref.Value { } return pref.ValueOfBytes(v.Convert(bytesType).Bytes()) } - func (c *bytesConverter) GoValueOf(v pref.Value) reflect.Value { return reflect.ValueOf(v.Bytes()).Convert(c.goType) } - func (c *bytesConverter) IsValidPB(v pref.Value) bool { _, ok := v.Interface().([]byte) return ok } - func (c *bytesConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } diff --git a/vendor/google.golang.org/protobuf/internal/impl/convert_list.go b/vendor/google.golang.org/protobuf/internal/impl/convert_list.go index da176d9..6fccab5 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/convert_list.go +++ b/vendor/google.golang.org/protobuf/internal/impl/convert_list.go @@ -110,19 +110,15 @@ func (ls *listReflect) Len() int { } return ls.v.Elem().Len() } - func (ls *listReflect) Get(i int) pref.Value { return ls.conv.PBValueOf(ls.v.Elem().Index(i)) } - func (ls *listReflect) Set(i int, v pref.Value) { ls.v.Elem().Index(i).Set(ls.conv.GoValueOf(v)) } - func (ls *listReflect) Append(v pref.Value) { ls.v.Elem().Set(reflect.Append(ls.v.Elem(), ls.conv.GoValueOf(v))) } - func (ls *listReflect) AppendMutable() pref.Value { if _, ok := ls.conv.(*messageConverter); !ok { panic("invalid AppendMutable on list with non-message type") @@ -131,19 +127,15 @@ func (ls *listReflect) AppendMutable() pref.Value { ls.Append(v) return v } - func (ls *listReflect) Truncate(i int) { ls.v.Elem().Set(ls.v.Elem().Slice(0, i)) } - func (ls *listReflect) NewElement() pref.Value { return ls.conv.New() } - func (ls *listReflect) IsValid() bool { return !ls.v.IsNil() } - func (ls *listReflect) protoUnwrap() interface{} { return ls.v.Interface() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/convert_map.go b/vendor/google.golang.org/protobuf/internal/impl/convert_map.go index e37d559..de06b25 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/convert_map.go +++ b/vendor/google.golang.org/protobuf/internal/impl/convert_map.go @@ -67,13 +67,11 @@ type mapReflect struct { func (ms *mapReflect) Len() int { return ms.v.Len() } - func (ms *mapReflect) Has(k pref.MapKey) bool { rk := ms.keyConv.GoValueOf(k.Value()) rv := ms.v.MapIndex(rk) return rv.IsValid() } - func (ms *mapReflect) Get(k pref.MapKey) pref.Value { rk := ms.keyConv.GoValueOf(k.Value()) rv := ms.v.MapIndex(rk) @@ -82,18 +80,15 @@ func (ms *mapReflect) Get(k pref.MapKey) pref.Value { } return ms.valConv.PBValueOf(rv) } - func (ms *mapReflect) Set(k pref.MapKey, v pref.Value) { rk := ms.keyConv.GoValueOf(k.Value()) rv := ms.valConv.GoValueOf(v) ms.v.SetMapIndex(rk, rv) } - func (ms *mapReflect) Clear(k pref.MapKey) { rk := ms.keyConv.GoValueOf(k.Value()) ms.v.SetMapIndex(rk, reflect.Value{}) } - func (ms *mapReflect) Mutable(k pref.MapKey) pref.Value { if _, ok := ms.valConv.(*messageConverter); !ok { panic("invalid Mutable on map with non-message value type") @@ -105,7 +100,6 @@ func (ms *mapReflect) Mutable(k pref.MapKey) pref.Value { } return v } - func (ms *mapReflect) Range(f func(pref.MapKey, pref.Value) bool) { iter := mapRange(ms.v) for iter.Next() { @@ -116,15 +110,12 @@ func (ms *mapReflect) Range(f func(pref.MapKey, pref.Value) bool) { } } } - func (ms *mapReflect) NewValue() pref.Value { return ms.valConv.New() } - func (ms *mapReflect) IsValid() bool { return !ms.v.IsNil() } - func (ms *mapReflect) protoUnwrap() interface{} { return ms.v.Interface() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/extension.go b/vendor/google.golang.org/protobuf/internal/impl/extension.go index fdd53c6..e904fd9 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/extension.go +++ b/vendor/google.golang.org/protobuf/internal/impl/extension.go @@ -92,27 +92,21 @@ func InitExtensionInfo(xi *ExtensionInfo, xd pref.ExtensionDescriptor, goType re func (xi *ExtensionInfo) New() pref.Value { return xi.lazyInit().New() } - func (xi *ExtensionInfo) Zero() pref.Value { return xi.lazyInit().Zero() } - func (xi *ExtensionInfo) ValueOf(v interface{}) pref.Value { return xi.lazyInit().PBValueOf(reflect.ValueOf(v)) } - func (xi *ExtensionInfo) InterfaceOf(v pref.Value) interface{} { return xi.lazyInit().GoValueOf(v).Interface() } - func (xi *ExtensionInfo) IsValidValue(v pref.Value) bool { return xi.lazyInit().IsValidPB(v) } - func (xi *ExtensionInfo) IsValidInterface(v interface{}) bool { return xi.lazyInit().IsValidGo(reflect.ValueOf(v)) } - func (xi *ExtensionInfo) TypeDescriptor() pref.ExtensionTypeDescriptor { if atomic.LoadUint32(&xi.init) < extensionInfoDescInit { xi.lazyInitSlow() @@ -157,7 +151,6 @@ type extensionTypeDescriptor struct { func (xtd *extensionTypeDescriptor) Type() pref.ExtensionType { return xtd.xi } - func (xtd *extensionTypeDescriptor) Descriptor() pref.ExtensionDescriptor { return xtd.ExtensionDescriptor } diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go index 111f0fc..f7d7ffb 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go @@ -76,7 +76,6 @@ func (t *legacyEnumType) New(n pref.EnumNumber) pref.Enum { t.m.Store(n, e) return e } - func (t *legacyEnumType) Descriptor() pref.EnumDescriptor { return t.desc } @@ -90,19 +89,15 @@ type legacyEnumWrapper struct { func (e *legacyEnumWrapper) Descriptor() pref.EnumDescriptor { return e.pbTyp.Descriptor() } - func (e *legacyEnumWrapper) Type() pref.EnumType { return e.pbTyp } - func (e *legacyEnumWrapper) Number() pref.EnumNumber { return e.num } - func (e *legacyEnumWrapper) ProtoReflect() pref.Enum { return e } - func (e *legacyEnumWrapper) protoUnwrap() interface{} { v := reflect.New(e.goTyp).Elem() v.SetInt(int64(e.num)) diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go index 8f9be08..c3d741c 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go @@ -60,7 +60,7 @@ func (Export) UnmarshalJSONEnum(ed pref.EnumDescriptor, b []byte) (pref.EnumNumb // The current implementation does no compression. func (Export) CompressGZIP(in []byte) (out []byte) { // RFC 1952, section 2.3.1. - gzipHeader := [10]byte{0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff} + var gzipHeader = [10]byte{0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff} // RFC 1951, section 3.2.4. var blockHeader [5]byte diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go index 7ea40ec..9ab0910 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go @@ -73,11 +73,9 @@ type resolverOnly struct { func (r resolverOnly) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { return r.reg.FindFileByPath(path) } - func (r resolverOnly) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { return r.reg.FindDescriptorByName(name) } - func (resolverOnly) RegisterFile(protoreflect.FileDescriptor) error { return nil } diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go index 19e9e60..06c68e1 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go @@ -81,7 +81,6 @@ var legacyMessageDescCache sync.Map // map[reflect.Type]protoreflect.MessageDesc func LegacyLoadMessageDesc(t reflect.Type) pref.MessageDescriptor { return legacyLoadMessageDesc(t, "") } - func legacyLoadMessageDesc(t reflect.Type, name pref.FullName) pref.MessageDescriptor { // Fast-path: check if a MessageDescriptor is cached for this concrete type. if mi, ok := legacyMessageDescCache.Load(t); ok { @@ -160,7 +159,6 @@ func aberrantLoadMessageDesc(t reflect.Type, name pref.FullName) pref.MessageDes } return aberrantLoadMessageDescReentrant(t, name) } - func aberrantLoadMessageDescReentrant(t reflect.Type, name pref.FullName) pref.MessageDescriptor { // Fast-path: check if an MessageDescriptor is cached for this concrete type. if md, ok := aberrantMessageDescCache[t]; ok { @@ -426,15 +424,12 @@ type aberrantMessageType struct { func (mt aberrantMessageType) New() pref.Message { return aberrantMessage{reflect.Zero(mt.t)} } - func (mt aberrantMessageType) Zero() pref.Message { return aberrantMessage{reflect.Zero(mt.t)} } - func (mt aberrantMessageType) GoType() reflect.Type { return mt.t } - func (mt aberrantMessageType) Descriptor() pref.MessageDescriptor { return LegacyLoadMessageDesc(mt.t) } @@ -455,69 +450,53 @@ func (m aberrantMessage) ProtoReflect() pref.Message { func (m aberrantMessage) Descriptor() pref.MessageDescriptor { return LegacyLoadMessageDesc(m.v.Type()) } - func (m aberrantMessage) Type() pref.MessageType { return aberrantMessageType{m.v.Type()} } - func (m aberrantMessage) New() pref.Message { return aberrantMessage{reflect.Zero(m.v.Type())} } - func (m aberrantMessage) Interface() pref.ProtoMessage { return m } - func (m aberrantMessage) Range(f func(pref.FieldDescriptor, pref.Value) bool) { } - func (m aberrantMessage) Has(pref.FieldDescriptor) bool { panic("invalid field descriptor") } - func (m aberrantMessage) Clear(pref.FieldDescriptor) { panic("invalid field descriptor") } - func (m aberrantMessage) Get(pref.FieldDescriptor) pref.Value { panic("invalid field descriptor") } - func (m aberrantMessage) Set(pref.FieldDescriptor, pref.Value) { panic("invalid field descriptor") } - func (m aberrantMessage) Mutable(pref.FieldDescriptor) pref.Value { panic("invalid field descriptor") } - func (m aberrantMessage) NewField(pref.FieldDescriptor) pref.Value { panic("invalid field descriptor") } - func (m aberrantMessage) WhichOneof(pref.OneofDescriptor) pref.FieldDescriptor { panic("invalid oneof descriptor") } - func (m aberrantMessage) GetUnknown() pref.RawFields { return nil } - func (m aberrantMessage) SetUnknown(pref.RawFields) { // SetUnknown discards its input on messages which don't support unknown field storage. } - func (m aberrantMessage) IsValid() bool { // An invalid message is a read-only, empty message. Since we don't know anything // about the alleged contents of this message, we can't say with confidence that // it is invalid in this sense. Therefore, report it as valid. return true } - func (m aberrantMessage) ProtoMethods() *piface.Methods { return legacyProtoMethods } - func (m aberrantMessage) protoUnwrap() interface{} { return m.v.Interface() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/merge_gen.go b/vendor/google.golang.org/protobuf/internal/impl/merge_gen.go index 8198268..8816c27 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/merge_gen.go +++ b/vendor/google.golang.org/protobuf/internal/impl/merge_gen.go @@ -6,6 +6,8 @@ package impl +import () + func mergeBool(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.Bool() = *src.Bool() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/message.go b/vendor/google.golang.org/protobuf/internal/impl/message.go index cff37bb..7dd994b 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message.go @@ -209,7 +209,6 @@ fieldLoop: func (mi *MessageInfo) New() protoreflect.Message { return mi.MessageOf(reflect.New(mi.GoReflectType.Elem()).Interface()) } - func (mi *MessageInfo) Zero() protoreflect.Message { return mi.MessageOf(reflect.Zero(mi.GoReflectType).Interface()) } diff --git a/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go b/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go index c659006..0f4b8db 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go @@ -156,7 +156,6 @@ func (m *extensionMap) Range(f func(pref.FieldDescriptor, pref.Value) bool) { } } } - func (m *extensionMap) Has(xt pref.ExtensionType) (ok bool) { if m == nil { return false @@ -176,11 +175,9 @@ func (m *extensionMap) Has(xt pref.ExtensionType) (ok bool) { } return true } - func (m *extensionMap) Clear(xt pref.ExtensionType) { delete(*m, int32(xt.TypeDescriptor().Number())) } - func (m *extensionMap) Get(xt pref.ExtensionType) pref.Value { xd := xt.TypeDescriptor() if m != nil { @@ -190,7 +187,6 @@ func (m *extensionMap) Get(xt pref.ExtensionType) pref.Value { } return xt.Zero() } - func (m *extensionMap) Set(xt pref.ExtensionType, v pref.Value) { xd := xt.TypeDescriptor() isValid := true @@ -215,7 +211,6 @@ func (m *extensionMap) Set(xt pref.ExtensionType, v pref.Value) { x.Set(xt, v) (*m)[int32(xd.Number())] = x } - func (m *extensionMap) Mutable(xt pref.ExtensionType) pref.Value { xd := xt.TypeDescriptor() if xd.Kind() != pref.MessageKind && xd.Kind() != pref.GroupKind && !xd.IsList() && !xd.IsMap() { @@ -328,7 +323,6 @@ func (m *messageReflectWrapper) messageInfo() *MessageInfo { return m.mi } func (m *messageIfaceWrapper) ProtoReflect() pref.Message { return (*messageReflectWrapper)(m) } - func (m *messageIfaceWrapper) protoUnwrap() interface{} { return m.p.AsIfaceOf(m.mi.GoReflectType.Elem()) } diff --git a/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go b/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go index 73b5b47..741d6e5 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go @@ -14,23 +14,18 @@ import ( func (m *messageState) Descriptor() protoreflect.MessageDescriptor { return m.messageInfo().Desc } - func (m *messageState) Type() protoreflect.MessageType { return m.messageInfo() } - func (m *messageState) New() protoreflect.Message { return m.messageInfo().New() } - func (m *messageState) Interface() protoreflect.ProtoMessage { return m.protoUnwrap().(protoreflect.ProtoMessage) } - func (m *messageState) protoUnwrap() interface{} { return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) } - func (m *messageState) ProtoMethods() *protoiface.Methods { m.messageInfo().init() return &m.messageInfo().methods @@ -66,7 +61,6 @@ func (m *messageState) Range(f func(protoreflect.FieldDescriptor, protoreflect.V } m.messageInfo().extensionMap(m.pointer()).Range(f) } - func (m *messageState) Has(fd protoreflect.FieldDescriptor) bool { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -75,7 +69,6 @@ func (m *messageState) Has(fd protoreflect.FieldDescriptor) bool { return m.messageInfo().extensionMap(m.pointer()).Has(xt) } } - func (m *messageState) Clear(fd protoreflect.FieldDescriptor) { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -84,7 +77,6 @@ func (m *messageState) Clear(fd protoreflect.FieldDescriptor) { m.messageInfo().extensionMap(m.pointer()).Clear(xt) } } - func (m *messageState) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -93,7 +85,6 @@ func (m *messageState) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { return m.messageInfo().extensionMap(m.pointer()).Get(xt) } } - func (m *messageState) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -102,7 +93,6 @@ func (m *messageState) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value m.messageInfo().extensionMap(m.pointer()).Set(xt, v) } } - func (m *messageState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -111,7 +101,6 @@ func (m *messageState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Val return m.messageInfo().extensionMap(m.pointer()).Mutable(xt) } } - func (m *messageState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -120,7 +109,6 @@ func (m *messageState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Va return xt.New() } } - func (m *messageState) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { m.messageInfo().init() if oi := m.messageInfo().oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { @@ -128,17 +116,14 @@ func (m *messageState) WhichOneof(od protoreflect.OneofDescriptor) protoreflect. } panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName())) } - func (m *messageState) GetUnknown() protoreflect.RawFields { m.messageInfo().init() return m.messageInfo().getUnknown(m.pointer()) } - func (m *messageState) SetUnknown(b protoreflect.RawFields) { m.messageInfo().init() m.messageInfo().setUnknown(m.pointer(), b) } - func (m *messageState) IsValid() bool { return !m.pointer().IsNil() } @@ -146,26 +131,21 @@ func (m *messageState) IsValid() bool { func (m *messageReflectWrapper) Descriptor() protoreflect.MessageDescriptor { return m.messageInfo().Desc } - func (m *messageReflectWrapper) Type() protoreflect.MessageType { return m.messageInfo() } - func (m *messageReflectWrapper) New() protoreflect.Message { return m.messageInfo().New() } - func (m *messageReflectWrapper) Interface() protoreflect.ProtoMessage { if m, ok := m.protoUnwrap().(protoreflect.ProtoMessage); ok { return m } return (*messageIfaceWrapper)(m) } - func (m *messageReflectWrapper) protoUnwrap() interface{} { return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) } - func (m *messageReflectWrapper) ProtoMethods() *protoiface.Methods { m.messageInfo().init() return &m.messageInfo().methods @@ -201,7 +181,6 @@ func (m *messageReflectWrapper) Range(f func(protoreflect.FieldDescriptor, proto } m.messageInfo().extensionMap(m.pointer()).Range(f) } - func (m *messageReflectWrapper) Has(fd protoreflect.FieldDescriptor) bool { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -210,7 +189,6 @@ func (m *messageReflectWrapper) Has(fd protoreflect.FieldDescriptor) bool { return m.messageInfo().extensionMap(m.pointer()).Has(xt) } } - func (m *messageReflectWrapper) Clear(fd protoreflect.FieldDescriptor) { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -219,7 +197,6 @@ func (m *messageReflectWrapper) Clear(fd protoreflect.FieldDescriptor) { m.messageInfo().extensionMap(m.pointer()).Clear(xt) } } - func (m *messageReflectWrapper) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -228,7 +205,6 @@ func (m *messageReflectWrapper) Get(fd protoreflect.FieldDescriptor) protoreflec return m.messageInfo().extensionMap(m.pointer()).Get(xt) } } - func (m *messageReflectWrapper) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -237,7 +213,6 @@ func (m *messageReflectWrapper) Set(fd protoreflect.FieldDescriptor, v protorefl m.messageInfo().extensionMap(m.pointer()).Set(xt, v) } } - func (m *messageReflectWrapper) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -246,7 +221,6 @@ func (m *messageReflectWrapper) Mutable(fd protoreflect.FieldDescriptor) protore return m.messageInfo().extensionMap(m.pointer()).Mutable(xt) } } - func (m *messageReflectWrapper) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { m.messageInfo().init() if fi, xt := m.messageInfo().checkField(fd); fi != nil { @@ -255,7 +229,6 @@ func (m *messageReflectWrapper) NewField(fd protoreflect.FieldDescriptor) protor return xt.New() } } - func (m *messageReflectWrapper) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { m.messageInfo().init() if oi := m.messageInfo().oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { @@ -263,17 +236,14 @@ func (m *messageReflectWrapper) WhichOneof(od protoreflect.OneofDescriptor) prot } panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName())) } - func (m *messageReflectWrapper) GetUnknown() protoreflect.RawFields { m.messageInfo().init() return m.messageInfo().getUnknown(m.pointer()) } - func (m *messageReflectWrapper) SetUnknown(b protoreflect.RawFields) { m.messageInfo().init() m.messageInfo().setUnknown(m.pointer(), b) } - func (m *messageReflectWrapper) IsValid() bool { return !m.pointer().IsNil() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go index 76b02cb..088aa85 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go @@ -143,12 +143,10 @@ func (Export) MessageStateOf(p Pointer) *messageState { // Super-tricky - see documentation on MessageState. return (*messageState)(unsafe.Pointer(p)) } - func (ms *messageState) pointer() pointer { // Super-tricky - see documentation on MessageState. return pointer{p: unsafe.Pointer(ms)} } - func (ms *messageState) messageInfo() *MessageInfo { mi := ms.LoadMessageInfo() if mi == nil { @@ -156,11 +154,9 @@ func (ms *messageState) messageInfo() *MessageInfo { } return mi } - func (ms *messageState) LoadMessageInfo() *MessageInfo { return (*MessageInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&ms.atomicMessageInfo)))) } - func (ms *messageState) StoreMessageInfo(mi *MessageInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&ms.atomicMessageInfo)), unsafe.Pointer(mi)) } diff --git a/vendor/google.golang.org/protobuf/internal/set/ints.go b/vendor/google.golang.org/protobuf/internal/set/ints.go index bed0e30..d3d7f89 100644 --- a/vendor/google.golang.org/protobuf/internal/set/ints.go +++ b/vendor/google.golang.org/protobuf/internal/set/ints.go @@ -13,15 +13,12 @@ type int64s uint64 func (bs *int64s) Len() int { return bits.OnesCount64(uint64(*bs)) } - func (bs *int64s) Has(n uint64) bool { return uint64(*bs)&(uint64(1)< 0 } - func (bs *int64s) Set(n uint64) { *(*uint64)(bs) |= uint64(1) << n } - func (bs *int64s) Clear(n uint64) { *(*uint64)(bs) &^= uint64(1) << n } @@ -35,7 +32,6 @@ type Ints struct { func (bs *Ints) Len() int { return bs.lo.Len() + len(bs.hi) } - func (bs *Ints) Has(n uint64) bool { if n < 64 { return bs.lo.Has(n) @@ -43,7 +39,6 @@ func (bs *Ints) Has(n uint64) bool { _, ok := bs.hi[n] return ok } - func (bs *Ints) Set(n uint64) { if n < 64 { bs.lo.Set(n) @@ -54,7 +49,6 @@ func (bs *Ints) Set(n uint64) { } bs.hi[n] = struct{}{} } - func (bs *Ints) Clear(n uint64) { if n < 64 { bs.lo.Clear(n) diff --git a/vendor/google.golang.org/protobuf/internal/strs/strings.go b/vendor/google.golang.org/protobuf/internal/strs/strings.go index 0b80225..0b74e76 100644 --- a/vendor/google.golang.org/protobuf/internal/strs/strings.go +++ b/vendor/google.golang.org/protobuf/internal/strs/strings.go @@ -188,11 +188,9 @@ func TrimEnumPrefix(s, prefix string) string { func isASCIILower(c byte) bool { return 'a' <= c && c <= 'z' } - func isASCIIUpper(c byte) bool { return 'A' <= c && c <= 'Z' } - func isASCIIDigit(c byte) bool { return '0' <= c && c <= '9' } diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go index b582b6c..918e685 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go @@ -41,11 +41,9 @@ type value struct { func valueOfString(v string) Value { return Value{typ: stringType, str: v} } - func valueOfBytes(v []byte) Value { return Value{typ: bytesType, bin: v} } - func valueOfIface(v interface{}) Value { return Value{typ: ifaceType, iface: v} } @@ -53,11 +51,9 @@ func valueOfIface(v interface{}) Value { func (v Value) getString() string { return v.str } - func (v Value) getBytes() []byte { return v.bin } - func (v Value) getIface() interface{} { return v.iface } diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go index 34f2f4a..c45debd 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go @@ -75,12 +75,10 @@ func valueOfString(v string) Value { p := (*stringHeader)(unsafe.Pointer(&v)) return Value{typ: stringType, ptr: p.Data, num: uint64(len(v))} } - func valueOfBytes(v []byte) Value { p := (*sliceHeader)(unsafe.Pointer(&v)) return Value{typ: bytesType, ptr: p.Data, num: uint64(len(v))} } - func valueOfIface(v interface{}) Value { p := (*ifaceHeader)(unsafe.Pointer(&v)) return Value{typ: p.Type, ptr: p.Data} @@ -90,12 +88,10 @@ func (v Value) getString() (x string) { *(*stringHeader)(unsafe.Pointer(&x)) = stringHeader{Data: v.ptr, Len: int(v.num)} return x } - func (v Value) getBytes() (x []byte) { *(*sliceHeader)(unsafe.Pointer(&x)) = sliceHeader{Data: v.ptr, Len: int(v.num), Cap: int(v.num)} return x } - func (v Value) getIface() (x interface{}) { *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} return x diff --git a/vendor/gopkg.in/go-playground/validator.v9/baked_in.go b/vendor/gopkg.in/go-playground/validator.v9/baked_in.go index db81270..cfc5686 100644 --- a/vendor/gopkg.in/go-playground/validator.v9/baked_in.go +++ b/vendor/gopkg.in/go-playground/validator.v9/baked_in.go @@ -169,10 +169,8 @@ var ( } ) -var ( - oneofValsCache = map[string][]string{} - oneofValsCacheRWLock = sync.RWMutex{} -) +var oneofValsCache = map[string][]string{} +var oneofValsCacheRWLock = sync.RWMutex{} func parseOneOfParam2(s string) []string { oneofValsCacheRWLock.RLock() @@ -225,6 +223,7 @@ func isOneOf(fl FieldLevel) bool { // isUnique is the validation function for validating if each array|slice|map value is unique func isUnique(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() v := reflect.ValueOf(struct{}{}) @@ -264,6 +263,7 @@ func isUnique(fl FieldLevel) bool { // IsMAC is the validation function for validating if the field's value is a valid MAC address. func isMAC(fl FieldLevel) bool { + _, err := net.ParseMAC(fl.Field().String()) return err == nil @@ -271,6 +271,7 @@ func isMAC(fl FieldLevel) bool { // IsCIDRv4 is the validation function for validating if the field's value is a valid v4 CIDR address. func isCIDRv4(fl FieldLevel) bool { + ip, _, err := net.ParseCIDR(fl.Field().String()) return err == nil && ip.To4() != nil @@ -278,6 +279,7 @@ func isCIDRv4(fl FieldLevel) bool { // IsCIDRv6 is the validation function for validating if the field's value is a valid v6 CIDR address. func isCIDRv6(fl FieldLevel) bool { + ip, _, err := net.ParseCIDR(fl.Field().String()) return err == nil && ip.To4() == nil @@ -285,6 +287,7 @@ func isCIDRv6(fl FieldLevel) bool { // IsCIDR is the validation function for validating if the field's value is a valid v4 or v6 CIDR address. func isCIDR(fl FieldLevel) bool { + _, _, err := net.ParseCIDR(fl.Field().String()) return err == nil @@ -292,6 +295,7 @@ func isCIDR(fl FieldLevel) bool { // IsIPv4 is the validation function for validating if a value is a valid v4 IP address. func isIPv4(fl FieldLevel) bool { + ip := net.ParseIP(fl.Field().String()) return ip != nil && ip.To4() != nil @@ -299,6 +303,7 @@ func isIPv4(fl FieldLevel) bool { // IsIPv6 is the validation function for validating if the field's value is a valid v6 IP address. func isIPv6(fl FieldLevel) bool { + ip := net.ParseIP(fl.Field().String()) return ip != nil && ip.To4() == nil @@ -306,6 +311,7 @@ func isIPv6(fl FieldLevel) bool { // IsIP is the validation function for validating if the field's value is a valid v4 or v6 IP address. func isIP(fl FieldLevel) bool { + ip := net.ParseIP(fl.Field().String()) return ip != nil @@ -313,6 +319,7 @@ func isIP(fl FieldLevel) bool { // IsSSN is the validation function for validating if the field's value is a valid SSN. func isSSN(fl FieldLevel) bool { + field := fl.Field() if field.Len() != 11 { @@ -370,6 +377,7 @@ func isLatitude(fl FieldLevel) bool { // IsDataURI is the validation function for validating if the field's value is a valid data URI. func isDataURI(fl FieldLevel) bool { + uri := strings.SplitN(fl.Field().String(), ",", 2) if len(uri) != 2 { @@ -385,6 +393,7 @@ func isDataURI(fl FieldLevel) bool { // HasMultiByteCharacter is the validation function for validating if the field's value has a multi byte character. func hasMultiByteCharacter(fl FieldLevel) bool { + field := fl.Field() if field.Len() == 0 { @@ -451,6 +460,7 @@ func isISBN(fl FieldLevel) bool { // IsISBN13 is the validation function for validating if the field's value is a valid v13 ISBN. func isISBN13(fl FieldLevel) bool { + s := strings.Replace(strings.Replace(fl.Field().String(), "-", "", 4), " ", "", 4) if !iSBN13Regex.MatchString(s) { @@ -471,6 +481,7 @@ func isISBN13(fl FieldLevel) bool { // IsISBN10 is the validation function for validating if the field's value is a valid v10 ISBN. func isISBN10(fl FieldLevel) bool { + s := strings.Replace(strings.Replace(fl.Field().String(), "-", "", 3), " ", "", 3) if !iSBN10Regex.MatchString(s) { @@ -644,6 +655,7 @@ func excludes(fl FieldLevel) bool { // ContainsRune is the validation function for validating that the field's value contains the rune specified within the param. func containsRune(fl FieldLevel) bool { + r, _ := utf8.DecodeRuneInString(fl.Param()) return strings.ContainsRune(fl.Field().String(), r) @@ -696,6 +708,7 @@ func fieldExcludes(fl FieldLevel) bool { // IsNeField is the validation function for validating if the current field's value is not equal to the field specified by the param's value. func isNeField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -749,6 +762,7 @@ func isNe(fl FieldLevel) bool { // IsLteCrossStructField is the validation function for validating if the current field's value is less than or equal to the field, within a separate struct, specified by the param's value. func isLteCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -796,6 +810,7 @@ func isLteCrossStructField(fl FieldLevel) bool { // IsLtCrossStructField is the validation function for validating if the current field's value is less than the field, within a separate struct, specified by the param's value. // NOTE: This is exposed for use within your own custom functions and not intended to be called directly. func isLtCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -842,6 +857,7 @@ func isLtCrossStructField(fl FieldLevel) bool { // IsGteCrossStructField is the validation function for validating if the current field's value is greater than or equal to the field, within a separate struct, specified by the param's value. func isGteCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -888,6 +904,7 @@ func isGteCrossStructField(fl FieldLevel) bool { // IsGtCrossStructField is the validation function for validating if the current field's value is greater than the field, within a separate struct, specified by the param's value. func isGtCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -934,6 +951,7 @@ func isGtCrossStructField(fl FieldLevel) bool { // IsNeCrossStructField is the validation function for validating that the current field's value is not equal to the field, within a separate struct, specified by the param's value. func isNeCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -980,6 +998,7 @@ func isNeCrossStructField(fl FieldLevel) bool { // IsEqCrossStructField is the validation function for validating that the current field's value is equal to the field, within a separate struct, specified by the param's value. func isEqCrossStructField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1026,6 +1045,7 @@ func isEqCrossStructField(fl FieldLevel) bool { // IsEqField is the validation function for validating if the current field's value is equal to the field specified by the param's value. func isEqField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1073,6 +1093,7 @@ func isEqField(fl FieldLevel) bool { // IsEq is the validation function for validating if the current field's value is equal to the param's value. func isEq(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1117,9 +1138,11 @@ func isBase64URL(fl FieldLevel) bool { // IsURI is the validation function for validating if the current field's value is a valid URI. func isURI(fl FieldLevel) bool { + field := fl.Field() switch field.Kind() { + case reflect.String: s := field.String() @@ -1144,9 +1167,11 @@ func isURI(fl FieldLevel) bool { // IsURL is the validation function for validating if the current field's value is a valid URL. func isURL(fl FieldLevel) bool { + field := fl.Field() switch field.Kind() { + case reflect.String: var i int @@ -1179,6 +1204,7 @@ func isUrnRFC2141(fl FieldLevel) bool { field := fl.Field() switch field.Kind() { + case reflect.String: str := field.String() @@ -1378,6 +1404,7 @@ func requiredWithoutAll(fl FieldLevel) bool { // IsGteField is the validation function for validating if the current field's value is greater than or equal to the field specified by the param's value. func isGteField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1424,6 +1451,7 @@ func isGteField(fl FieldLevel) bool { // IsGtField is the validation function for validating if the current field's value is greater than the field specified by the param's value. func isGtField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1470,6 +1498,7 @@ func isGtField(fl FieldLevel) bool { // IsGte is the validation function for validating if the current field's value is greater than or equal to the param's value. func isGte(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1516,6 +1545,7 @@ func isGte(fl FieldLevel) bool { // IsGt is the validation function for validating if the current field's value is greater than the param's value. func isGt(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1548,6 +1578,7 @@ func isGt(fl FieldLevel) bool { case reflect.Struct: if field.Type() == timeType { + return field.Interface().(time.Time).After(time.Now().UTC()) } } @@ -1557,6 +1588,7 @@ func isGt(fl FieldLevel) bool { // HasLengthOf is the validation function for validating if the current field's value is equal to the param's value. func hasLengthOf(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1598,6 +1630,7 @@ func hasMinOf(fl FieldLevel) bool { // IsLteField is the validation function for validating if the current field's value is less than or equal to the field specified by the param's value. func isLteField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1644,6 +1677,7 @@ func isLteField(fl FieldLevel) bool { // IsLtField is the validation function for validating if the current field's value is less than the field specified by the param's value. func isLtField(fl FieldLevel) bool { + field := fl.Field() kind := field.Kind() @@ -1690,6 +1724,7 @@ func isLtField(fl FieldLevel) bool { // IsLte is the validation function for validating if the current field's value is less than or equal to the param's value. func isLte(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1736,6 +1771,7 @@ func isLte(fl FieldLevel) bool { // IsLt is the validation function for validating if the current field's value is less than the param's value. func isLt(fl FieldLevel) bool { + field := fl.Field() param := fl.Param() @@ -1769,6 +1805,7 @@ func isLt(fl FieldLevel) bool { case reflect.Struct: if field.Type() == timeType { + return field.Interface().(time.Time).Before(time.Now().UTC()) } } @@ -1783,6 +1820,7 @@ func hasMaxOf(fl FieldLevel) bool { // IsTCP4AddrResolvable is the validation function for validating if the field's value is a resolvable tcp4 address. func isTCP4AddrResolvable(fl FieldLevel) bool { + if !isIP4Addr(fl) { return false } @@ -1793,6 +1831,7 @@ func isTCP4AddrResolvable(fl FieldLevel) bool { // IsTCP6AddrResolvable is the validation function for validating if the field's value is a resolvable tcp6 address. func isTCP6AddrResolvable(fl FieldLevel) bool { + if !isIP6Addr(fl) { return false } @@ -1804,6 +1843,7 @@ func isTCP6AddrResolvable(fl FieldLevel) bool { // IsTCPAddrResolvable is the validation function for validating if the field's value is a resolvable tcp address. func isTCPAddrResolvable(fl FieldLevel) bool { + if !isIP4Addr(fl) && !isIP6Addr(fl) { return false } @@ -1815,6 +1855,7 @@ func isTCPAddrResolvable(fl FieldLevel) bool { // IsUDP4AddrResolvable is the validation function for validating if the field's value is a resolvable udp4 address. func isUDP4AddrResolvable(fl FieldLevel) bool { + if !isIP4Addr(fl) { return false } @@ -1826,6 +1867,7 @@ func isUDP4AddrResolvable(fl FieldLevel) bool { // IsUDP6AddrResolvable is the validation function for validating if the field's value is a resolvable udp6 address. func isUDP6AddrResolvable(fl FieldLevel) bool { + if !isIP6Addr(fl) { return false } @@ -1837,6 +1879,7 @@ func isUDP6AddrResolvable(fl FieldLevel) bool { // IsUDPAddrResolvable is the validation function for validating if the field's value is a resolvable udp address. func isUDPAddrResolvable(fl FieldLevel) bool { + if !isIP4Addr(fl) && !isIP6Addr(fl) { return false } @@ -1848,6 +1891,7 @@ func isUDPAddrResolvable(fl FieldLevel) bool { // IsIP4AddrResolvable is the validation function for validating if the field's value is a resolvable ip4 address. func isIP4AddrResolvable(fl FieldLevel) bool { + if !isIPv4(fl) { return false } @@ -1859,6 +1903,7 @@ func isIP4AddrResolvable(fl FieldLevel) bool { // IsIP6AddrResolvable is the validation function for validating if the field's value is a resolvable ip6 address. func isIP6AddrResolvable(fl FieldLevel) bool { + if !isIPv6(fl) { return false } @@ -1870,6 +1915,7 @@ func isIP6AddrResolvable(fl FieldLevel) bool { // IsIPAddrResolvable is the validation function for validating if the field's value is a resolvable ip address. func isIPAddrResolvable(fl FieldLevel) bool { + if !isIP(fl) { return false } @@ -1881,12 +1927,14 @@ func isIPAddrResolvable(fl FieldLevel) bool { // IsUnixAddrResolvable is the validation function for validating if the field's value is a resolvable unix address. func isUnixAddrResolvable(fl FieldLevel) bool { + _, err := net.ResolveUnixAddr("unix", fl.Field().String()) return err == nil } func isIP4Addr(fl FieldLevel) bool { + val := fl.Field().String() if idx := strings.LastIndex(val, ":"); idx != -1 { @@ -1899,6 +1947,7 @@ func isIP4Addr(fl FieldLevel) bool { } func isIP6Addr(fl FieldLevel) bool { + val := fl.Field().String() if idx := strings.LastIndex(val, ":"); idx != -1 { diff --git a/vendor/gopkg.in/go-playground/validator.v9/errors.go b/vendor/gopkg.in/go-playground/validator.v9/errors.go index 9f2d253..46c24c9 100644 --- a/vendor/gopkg.in/go-playground/validator.v9/errors.go +++ b/vendor/gopkg.in/go-playground/validator.v9/errors.go @@ -24,6 +24,7 @@ type InvalidValidationError struct { // Error returns InvalidValidationError message func (e *InvalidValidationError) Error() string { + if e.Type == nil { return "validator: (nil)" } @@ -40,6 +41,7 @@ type ValidationErrors []FieldError // All information to create an error message specific to your application is contained within // the FieldError found within the ValidationErrors array func (ve ValidationErrors) Error() string { + buff := bytes.NewBufferString("") var fe *fieldError @@ -56,6 +58,7 @@ func (ve ValidationErrors) Error() string { // Translate translates all of the ValidationErrors func (ve ValidationErrors) Translate(ut ut.Translator) ValidationErrorsTranslations { + trans := make(ValidationErrorsTranslations) var fe *fieldError @@ -155,10 +158,8 @@ type FieldError interface { } // compile time interface checks -var ( - _ FieldError = new(fieldError) - _ error = new(fieldError) -) +var _ FieldError = new(fieldError) +var _ error = new(fieldError) // fieldError contains a single field's validation error along // with other properties that may be needed for error message creation @@ -203,6 +204,7 @@ func (fe *fieldError) StructNamespace() string { // Field returns the fields name with the tag name taking precedence over the // fields actual name. func (fe *fieldError) Field() string { + return fe.ns[len(fe.ns)-int(fe.fieldLen):] // // return fe.field // fld := fe.ns[len(fe.ns)-int(fe.fieldLen):] @@ -255,6 +257,7 @@ func (fe *fieldError) Error() string { // NOTE: is not registered translation can be found it returns the same // as calling fe.Error() func (fe *fieldError) Translate(ut ut.Translator) string { + m, ok := fe.v.transTagFunc[ut] if !ok { return fe.Error() diff --git a/vendor/gopkg.in/go-playground/validator.v9/struct_level.go b/vendor/gopkg.in/go-playground/validator.v9/struct_level.go index 5f55597..57691ee 100644 --- a/vendor/gopkg.in/go-playground/validator.v9/struct_level.go +++ b/vendor/gopkg.in/go-playground/validator.v9/struct_level.go @@ -107,6 +107,7 @@ func (v *validate) ExtractType(field reflect.Value) (reflect.Value, reflect.Kind // ReportError reports an error just by passing the field and tag information func (v *validate) ReportError(field interface{}, fieldName, structFieldName, tag, param string) { + fv, kind, _ := v.extractTypeInternal(reflect.ValueOf(field), false) if len(structFieldName) == 0 { @@ -160,6 +161,7 @@ func (v *validate) ReportError(field interface{}, fieldName, structFieldName, ta // // NOTE: this function prepends the current namespace to the relative ones. func (v *validate) ReportValidationErrors(relativeNamespace, relativeStructNamespace string, errs ValidationErrors) { + var err *fieldError for i := 0; i < len(errs); i++ { diff --git a/vendor/gopkg.in/go-playground/validator.v9/util.go b/vendor/gopkg.in/go-playground/validator.v9/util.go index 8951c74..71acbdc 100644 --- a/vendor/gopkg.in/go-playground/validator.v9/util.go +++ b/vendor/gopkg.in/go-playground/validator.v9/util.go @@ -10,6 +10,7 @@ import ( // It will dive into pointers, customTypes and return you the // underlying value and it's kind. func (v *validate) extractTypeInternal(current reflect.Value, nullable bool) (reflect.Value, reflect.Kind, bool) { + BEGIN: switch current.Kind() { case reflect.Ptr: @@ -40,6 +41,7 @@ BEGIN: default: if v.v.hasCustomFuncs { + if fn, ok := v.v.customFuncs[current.Type()]; ok { current = reflect.ValueOf(fn(current)) goto BEGIN @@ -56,6 +58,7 @@ BEGIN: // NOTE: when not successful ok will be false, this can happen when a nested struct is nil and so the field // could not be retrieved because it didn't exist. func (v *validate) getStructFieldOKInternal(val reflect.Value, namespace string) (current reflect.Value, kind reflect.Kind, nullable bool, found bool) { + BEGIN: current, kind, nullable = v.ExtractType(val) if kind == reflect.Invalid { @@ -219,6 +222,7 @@ BEGIN: // asInt returns the parameter as a int64 // or panics if it can't convert func asInt(param string) int64 { + i, err := strconv.ParseInt(param, 0, 64) panicIf(err) @@ -228,6 +232,7 @@ func asInt(param string) int64 { // asUint returns the parameter as a uint64 // or panics if it can't convert func asUint(param string) uint64 { + i, err := strconv.ParseUint(param, 0, 64) panicIf(err) @@ -237,6 +242,7 @@ func asUint(param string) uint64 { // asFloat returns the parameter as a float64 // or panics if it can't convert func asFloat(param string) float64 { + i, err := strconv.ParseFloat(param, 64) panicIf(err) diff --git a/vendor/gopkg.in/go-playground/validator.v9/validator.go b/vendor/gopkg.in/go-playground/validator.v9/validator.go index 6e70483..342e72e 100644 --- a/vendor/gopkg.in/go-playground/validator.v9/validator.go +++ b/vendor/gopkg.in/go-playground/validator.v9/validator.go @@ -31,6 +31,7 @@ type validate struct { // parent and current will be the same the first run of validateStruct func (v *validate) validateStruct(ctx context.Context, parent reflect.Value, current reflect.Value, typ reflect.Type, ns []byte, structNs []byte, ct *cTag) { + cs, ok := v.v.structCache.Get(typ) if !ok { cs = v.v.extractStructCache(current, typ.Name()) @@ -56,11 +57,13 @@ func (v *validate) validateStruct(ctx context.Context, parent reflect.Value, cur f = cs.fields[i] if v.isPartial { + if v.ffn != nil { // used with StructFiltered if v.ffn(append(structNs, f.name...)) { continue } + } else { // used with StructPartial & StructExcept _, ok = v.includeExclude[string(append(structNs, f.name...))] @@ -352,6 +355,7 @@ OUTER: v.ct = ct if ct.fn(ctx, v) { + // drain rest of the 'or' values, then continue or leave for { @@ -386,6 +390,7 @@ OUTER: } if ct.hasAlias { + v.errs = append(v.errs, &fieldError{ v: v.v, @@ -401,6 +406,7 @@ OUTER: typ: typ, }, ) + } else { tVal := string(v.misc)[1:] @@ -467,4 +473,5 @@ OUTER: ct = ct.next } } + } diff --git a/vendor/gopkg.in/go-playground/validator.v9/validator_instance.go b/vendor/gopkg.in/go-playground/validator.v9/validator_instance.go index 7cba54d..4a89d40 100644 --- a/vendor/gopkg.in/go-playground/validator.v9/validator_instance.go +++ b/vendor/gopkg.in/go-playground/validator.v9/validator_instance.go @@ -82,6 +82,7 @@ type Validate struct { // New returns a new instance of 'validate' with sane defaults. func New() *Validate { + tc := new(tagCache) tc.m.Store(make(map[string]*cTag)) @@ -103,6 +104,7 @@ func New() *Validate { // must copy validators for separate validations to be used in each instance for k, val := range bakedInValidators { + switch k { // these require that even if the value is nil that the validation should run, omitempty still overrides this behaviour case requiredWithTag, requiredWithAllTag, requiredWithoutTag, requiredWithoutAllTag: @@ -190,6 +192,7 @@ func (v *Validate) registerValidation(tag string, fn FuncCtx, bakedIn bool, nilC // // NOTE: this function is not thread-safe it is intended that these all be registered prior to any validation func (v *Validate) RegisterAlias(alias, tags string) { + _, ok := restrictedTags[alias] if ok || strings.ContainsAny(alias, restrictedTagChars) { @@ -213,6 +216,7 @@ func (v *Validate) RegisterStructValidation(fn StructLevelFunc, types ...interfa // NOTE: // - this method is not thread-safe it is intended that these all be registered prior to any validation func (v *Validate) RegisterStructValidationCtx(fn StructLevelFuncCtx, types ...interface{}) { + if v.structLevelFuncs == nil { v.structLevelFuncs = make(map[reflect.Type]StructLevelFuncCtx) } @@ -231,6 +235,7 @@ func (v *Validate) RegisterStructValidationCtx(fn StructLevelFuncCtx, types ...i // // NOTE: this method is not thread-safe it is intended that these all be registered prior to any validation func (v *Validate) RegisterCustomTypeFunc(fn CustomTypeFunc, types ...interface{}) { + if v.customFuncs == nil { v.customFuncs = make(map[reflect.Type]CustomTypeFunc) } @@ -244,6 +249,7 @@ func (v *Validate) RegisterCustomTypeFunc(fn CustomTypeFunc, types ...interface{ // RegisterTranslation registers translations against the provided tag. func (v *Validate) RegisterTranslation(tag string, trans ut.Translator, registerFn RegisterTranslationsFunc, translationFn TranslationFunc) (err error) { + if v.transTagFunc == nil { v.transTagFunc = make(map[ut.Translator]map[string]TranslationFunc) } @@ -277,6 +283,7 @@ func (v *Validate) Struct(s interface{}) error { // It returns InvalidValidationError for bad values passed in and nil or ValidationErrors as error otherwise. // You will need to assert the error if it's not nil eg. err.(validator.ValidationErrors) to access the array of errors. func (v *Validate) StructCtx(ctx context.Context, s interface{}) (err error) { + val := reflect.ValueOf(s) top := val diff --git a/vendor/gopkg.in/ini.v1/deprecated.go b/vendor/gopkg.in/ini.v1/deprecated.go index eda71f2..e8bda06 100644 --- a/vendor/gopkg.in/ini.v1/deprecated.go +++ b/vendor/gopkg.in/ini.v1/deprecated.go @@ -19,5 +19,7 @@ const ( DEFAULT_SECTION = DefaultSection ) -// Deprecated: AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE. -var AllCapsUnderscore = SnackCase +var ( + // Deprecated: AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE. + AllCapsUnderscore = SnackCase +) diff --git a/vendor/gopkg.in/ini.v1/key.go b/vendor/gopkg.in/ini.v1/key.go index 83a7f86..8baafd9 100644 --- a/vendor/gopkg.in/ini.v1/key.go +++ b/vendor/gopkg.in/ini.v1/key.go @@ -781,8 +781,10 @@ func (k *Key) parseUint64s(strs []string, addInvalid, returnOnInvalid bool) ([]u return vals, err } + type Parser func(str string) (interface{}, error) + // parseTimesFormat transforms strings to times in given format. func (k *Key) parseTimesFormat(format string, strs []string, addInvalid, returnOnInvalid bool) ([]time.Time, error) { vals := make([]time.Time, 0, len(strs)) @@ -799,6 +801,7 @@ func (k *Key) parseTimesFormat(format string, strs []string, addInvalid, returnO return vals, err } + // doParse transforms strings to different types func (k *Key) doParse(strs []string, addInvalid, returnOnInvalid bool, parser Parser) ([]interface{}, error) { vals := make([]interface{}, 0, len(strs)) diff --git a/vendor/gopkg.in/ini.v1/parser.go b/vendor/gopkg.in/ini.v1/parser.go index c112bdd..6514716 100644 --- a/vendor/gopkg.in/ini.v1/parser.go +++ b/vendor/gopkg.in/ini.v1/parser.go @@ -222,6 +222,7 @@ func hasSurroundedQuote(in string, quote byte) bool { } func (p *parser) readValue(in []byte, bufferSize int) (string, error) { + line := strings.TrimLeftFunc(string(in), unicode.IsSpace) if len(line) == 0 { if p.options.AllowPythonMultilineValues && len(in) > 0 && in[len(in)-1] == '\n' { diff --git a/vendor/gopkg.in/ini.v1/section.go b/vendor/gopkg.in/ini.v1/section.go index ec4d2c8..afaa97c 100644 --- a/vendor/gopkg.in/ini.v1/section.go +++ b/vendor/gopkg.in/ini.v1/section.go @@ -198,6 +198,7 @@ func (s *Section) ParentKeys() []*Key { } else { break } + } return parentKeys } diff --git a/vendor/gopkg.in/yaml.v2/apic.go b/vendor/gopkg.in/yaml.v2/apic.go index 5022f21..acf7140 100644 --- a/vendor/gopkg.in/yaml.v2/apic.go +++ b/vendor/gopkg.in/yaml.v2/apic.go @@ -5,7 +5,7 @@ import ( ) func yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) { - // fmt.Println("yaml_insert_token", "pos:", pos, "typ:", token.typ, "head:", parser.tokens_head, "len:", len(parser.tokens)) + //fmt.Println("yaml_insert_token", "pos:", pos, "typ:", token.typ, "head:", parser.tokens_head, "len:", len(parser.tokens)) // Check if we can move the queue at the beginning of the buffer. if parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) { diff --git a/vendor/gopkg.in/yaml.v2/decode.go b/vendor/gopkg.in/yaml.v2/decode.go index 3da2269..129bc2a 100644 --- a/vendor/gopkg.in/yaml.v2/decode.go +++ b/vendor/gopkg.in/yaml.v2/decode.go @@ -701,7 +701,7 @@ func (d *decoder) mappingSlice(n *node, out reflect.Value) (good bool) { d.mapType = outt var slice []MapItem - l := len(n.children) + var l = len(n.children) for i := 0; i < l; i += 2 { if isMerge(n.children[i]) { d.merge(n.children[i+1], out) diff --git a/vendor/gopkg.in/yaml.v2/emitterc.go b/vendor/gopkg.in/yaml.v2/emitterc.go index b243ae1..a1c2cc5 100644 --- a/vendor/gopkg.in/yaml.v2/emitterc.go +++ b/vendor/gopkg.in/yaml.v2/emitterc.go @@ -310,6 +310,7 @@ func yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t // Expect DOCUMENT-START or STREAM-END. func yaml_emitter_emit_document_start(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { + if event.typ == yaml_DOCUMENT_START_EVENT { if event.version_directive != nil { @@ -795,6 +796,7 @@ func yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool { // Determine an acceptable scalar style. func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool { + no_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 if no_tag && !event.implicit && !event.quoted_implicit { return yaml_emitter_set_emitter_error(emitter, "neither tag nor implicit flags are specified") @@ -1129,6 +1131,7 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { // Check if the event data is valid. func yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool { + emitter.anchor_data.anchor = nil emitter.tag_data.handle = nil emitter.tag_data.suffix = nil @@ -1365,6 +1368,7 @@ func yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte, allo } func yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { + if !yaml_emitter_write_indicator(emitter, []byte{'\''}, true, false, false) { return false } diff --git a/vendor/gopkg.in/yaml.v2/parserc.go b/vendor/gopkg.in/yaml.v2/parserc.go index 3017aa9..81d05df 100644 --- a/vendor/gopkg.in/yaml.v2/parserc.go +++ b/vendor/gopkg.in/yaml.v2/parserc.go @@ -91,7 +91,7 @@ func yaml_parser_set_parser_error_context(parser *yaml_parser_t, context string, // State dispatcher. func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool { - // trace("yaml_parser_state_machine", "state:", parser.state.String()) + //trace("yaml_parser_state_machine", "state:", parser.state.String()) switch parser.state { case yaml_PARSE_STREAM_START_STATE: @@ -196,6 +196,7 @@ func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) // explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* // ************************* func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool { + token := peek_token(parser) if token == nil { return false @@ -356,7 +357,7 @@ func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) // flow_content ::= flow_collection | SCALAR // ****** func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool { - // defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)() + //defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)() token := peek_token(parser) if token == nil { diff --git a/vendor/gopkg.in/yaml.v2/readerc.go b/vendor/gopkg.in/yaml.v2/readerc.go index 1092a58..7c1f5fa 100644 --- a/vendor/gopkg.in/yaml.v2/readerc.go +++ b/vendor/gopkg.in/yaml.v2/readerc.go @@ -95,7 +95,7 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { // [Go] This function was changed to guarantee the requested length size at EOF. // The fact we need to do this is pretty awful, but the description above implies - // for that to be the case, and there are tests + // for that to be the case, and there are tests // If the EOF flag is set and the raw buffer is empty, do nothing. if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) { @@ -104,7 +104,7 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { // given length in the buffer. Not doing that means every single // check that calls this function to make sure the buffer has a // given length is Go) panicking; or C) accessing invalid memory. - // return true + //return true } // Return if the buffer contains enough characters. diff --git a/vendor/gopkg.in/yaml.v2/resolve.go b/vendor/gopkg.in/yaml.v2/resolve.go index 1a53a63..4120e0c 100644 --- a/vendor/gopkg.in/yaml.v2/resolve.go +++ b/vendor/gopkg.in/yaml.v2/resolve.go @@ -14,10 +14,8 @@ type resolveMapItem struct { tag string } -var ( - resolveTable = make([]byte, 256) - resolveMap = make(map[string]resolveMapItem) -) +var resolveTable = make([]byte, 256) +var resolveMap = make(map[string]resolveMapItem) func init() { t := resolveTable @@ -31,7 +29,7 @@ func init() { } t[int('.')] = '.' // Float (potentially in map) - resolveMapList := []struct { + var resolveMapList = []struct { v interface{} tag string l []string @@ -182,7 +180,7 @@ func resolve(tag string, in string) (rtag string, out interface{}) { return yaml_INT_TAG, uintv } } else if strings.HasPrefix(plain, "-0b") { - intv, err := strconv.ParseInt("-"+plain[3:], 2, 64) + intv, err := strconv.ParseInt("-" + plain[3:], 2, 64) if err == nil { if true || intv == int64(int(intv)) { return yaml_INT_TAG, int(intv) diff --git a/vendor/gopkg.in/yaml.v2/scannerc.go b/vendor/gopkg.in/yaml.v2/scannerc.go index 62e4e33..0b9bb60 100644 --- a/vendor/gopkg.in/yaml.v2/scannerc.go +++ b/vendor/gopkg.in/yaml.v2/scannerc.go @@ -990,6 +990,7 @@ func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool { // Initialize the scanner and produce the STREAM-START token. func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool { + // Set the initial indentation. parser.indent = -1 @@ -1017,6 +1018,7 @@ func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool { // Produce the STREAM-END token and shut down the scanner. func yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool { + // Force new line. if parser.mark.column != 0 { parser.mark.column = 0 @@ -1235,6 +1237,7 @@ func yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool { // Produce the KEY token. func yaml_parser_fetch_key(parser *yaml_parser_t) bool { + // In the block context, additional checks are required. if parser.flow_level == 0 { // Check if we are allowed to start a new key (not nessesary simple). @@ -1273,11 +1276,13 @@ func yaml_parser_fetch_key(parser *yaml_parser_t) bool { // Produce the VALUE token. func yaml_parser_fetch_value(parser *yaml_parser_t) bool { + simple_key := &parser.simple_keys[len(parser.simple_keys)-1] // Have we found a simple key? if valid, ok := yaml_simple_key_is_valid(parser, simple_key); !ok { return false + } else if valid { // Create the KEY token and insert it into the queue. @@ -1436,6 +1441,7 @@ func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool { // Eat whitespaces and comments until the next token is found. func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool { + // Until the next token is not found. for { // Allow the BOM mark to start a line. @@ -1678,6 +1684,7 @@ const max_number_length = 2 // %YAML 1.1 # a comment \n // ^ func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool { + // Repeat while the next character is digit. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false @@ -1959,7 +1966,7 @@ func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_ma // Scan a tag. func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte, start_mark yaml_mark_t, uri *[]byte) bool { - // size_t length = head ? strlen((char *)head) : 0 + //size_t length = head ? strlen((char *)head) : 0 var s []byte hasTag := len(head) > 0 @@ -2017,6 +2024,7 @@ func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte // Decode an URI-escape sequence corresponding to a single UTF-8 character. func yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, s *[]byte) bool { + // Decode the required number of characters. w := 1024 for w > 0 { @@ -2351,6 +2359,7 @@ func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, si } else if !single && parser.buffer[parser.buffer_pos] == '"' { // It is a right double quote. break + } else if !single && parser.buffer[parser.buffer_pos] == '\\' && is_break(parser.buffer, parser.buffer_pos+1) { // It is an escaped line break. if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) { @@ -2559,9 +2568,10 @@ func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, si // Scan a plain scalar. func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool { + var s, leading_break, trailing_breaks, whitespaces []byte var leading_blanks bool - indent := parser.indent + 1 + var indent = parser.indent + 1 start_mark := parser.mark end_mark := parser.mark diff --git a/vendor/gopkg.in/yaml.v2/sorter.go b/vendor/gopkg.in/yaml.v2/sorter.go index 2edd734..4c45e66 100644 --- a/vendor/gopkg.in/yaml.v2/sorter.go +++ b/vendor/gopkg.in/yaml.v2/sorter.go @@ -52,7 +52,7 @@ func (l keyList) Less(i, j int) bool { var ai, bi int var an, bn int64 if ar[i] == '0' || br[i] == '0' { - for j := i - 1; j >= 0 && unicode.IsDigit(ar[j]); j-- { + for j := i-1; j >= 0 && unicode.IsDigit(ar[j]); j-- { if ar[j] != '0' { an = 1 bn = 1 diff --git a/vendor/gopkg.in/yaml.v2/yaml.go b/vendor/gopkg.in/yaml.v2/yaml.go index 8f7bd42..3081388 100644 --- a/vendor/gopkg.in/yaml.v2/yaml.go +++ b/vendor/gopkg.in/yaml.v2/yaml.go @@ -304,10 +304,8 @@ type fieldInfo struct { Inline []int } -var ( - structMap = make(map[reflect.Type]*structInfo) - fieldMapMutex sync.RWMutex -) +var structMap = make(map[reflect.Type]*structInfo) +var fieldMapMutex sync.RWMutex func getStructInfo(st reflect.Type) (*structInfo, error) { fieldMapMutex.RLock() @@ -385,7 +383,7 @@ func getStructInfo(st reflect.Type) (*structInfo, error) { fieldsList = append(fieldsList, finfo) } default: - // return nil, errors.New("Option ,inline needs a struct value or map field") + //return nil, errors.New("Option ,inline needs a struct value or map field") return nil, errors.New("Option ,inline needs a struct value field") } continue diff --git a/vendor/gopkg.in/yaml.v2/yamlprivateh.go b/vendor/gopkg.in/yaml.v2/yamlprivateh.go index c97ca60..8110ce3 100644 --- a/vendor/gopkg.in/yaml.v2/yamlprivateh.go +++ b/vendor/gopkg.in/yaml.v2/yamlprivateh.go @@ -94,7 +94,7 @@ func is_tab(b []byte, i int) bool { // Check if the character at the specified position is blank (space or tab). func is_blank(b []byte, i int) bool { - // return is_space(b, i) || is_tab(b, i) + //return is_space(b, i) || is_tab(b, i) return b[i] == ' ' || b[i] == '\t' } @@ -113,7 +113,7 @@ func is_crlf(b []byte, i int) bool { // Check if the character is a line break or NUL. func is_breakz(b []byte, i int) bool { - // return is_break(b, i) || is_z(b, i) + //return is_break(b, i) || is_z(b, i) return ( // is_break: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) @@ -126,7 +126,7 @@ func is_breakz(b []byte, i int) bool { // Check if the character is a line break, space, or NUL. func is_spacez(b []byte, i int) bool { - // return is_space(b, i) || is_breakz(b, i) + //return is_space(b, i) || is_breakz(b, i) return ( // is_space: b[i] == ' ' || // is_breakz: @@ -140,7 +140,7 @@ func is_spacez(b []byte, i int) bool { // Check if the character is a line break, space, tab, or NUL. func is_blankz(b []byte, i int) bool { - // return is_blank(b, i) || is_breakz(b, i) + //return is_blank(b, i) || is_breakz(b, i) return ( // is_blank: b[i] == ' ' || b[i] == '\t' || // is_breakz: @@ -169,4 +169,5 @@ func width(b byte) int { return 4 } return 0 + } diff --git a/vendor/modules.txt b/vendor/modules.txt index 3d41b83..78bc05e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -87,7 +87,7 @@ github.com/daaku/go.zipexe github.com/fsnotify/fsnotify # github.com/gin-contrib/sse v0.1.0 github.com/gin-contrib/sse -# github.com/gin-gonic/gin v1.7.2 +# github.com/gin-gonic/gin v1.7.7 github.com/gin-gonic/gin github.com/gin-gonic/gin/binding github.com/gin-gonic/gin/internal/bytesconv