diff options
author | Sascha Grunert <sgrunert@suse.com> | 2019-09-05 16:58:06 +0200 |
---|---|---|
committer | Sascha Grunert <sgrunert@suse.com> | 2019-09-05 16:58:08 +0200 |
commit | f66a2069f1b26ff9987b008ba4b0c91ac3b682cc (patch) | |
tree | 1219ee0e7b87494eaf2c6ace56d4ecada0dc4a39 /vendor/github.com/json-iterator/go/reflect_native.go | |
parent | b962b1e3538312f145aea0cf5546ae31f35f635f (diff) | |
download | podman-f66a2069f1b26ff9987b008ba4b0c91ac3b682cc.tar.gz podman-f66a2069f1b26ff9987b008ba4b0c91ac3b682cc.tar.bz2 podman-f66a2069f1b26ff9987b008ba4b0c91ac3b682cc.zip |
Update buildah to v1.11.0
Vendor in the latest changes for buildah to apply the implemented
features here as well.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Diffstat (limited to 'vendor/github.com/json-iterator/go/reflect_native.go')
-rw-r--r-- | vendor/github.com/json-iterator/go/reflect_native.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/vendor/github.com/json-iterator/go/reflect_native.go b/vendor/github.com/json-iterator/go/reflect_native.go index 9042eb0cb..f88722d14 100644 --- a/vendor/github.com/json-iterator/go/reflect_native.go +++ b/vendor/github.com/json-iterator/go/reflect_native.go @@ -432,17 +432,19 @@ func (codec *base64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { } func (codec *base64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { - src := *((*[]byte)(ptr)) - if len(src) == 0 { + if codec.sliceType.UnsafeIsNil(ptr) { stream.WriteNil() return } + src := *((*[]byte)(ptr)) encoding := base64.StdEncoding stream.writeByte('"') - size := encoding.EncodedLen(len(src)) - buf := make([]byte, size) - encoding.Encode(buf, src) - stream.buf = append(stream.buf, buf...) + if len(src) != 0 { + size := encoding.EncodedLen(len(src)) + buf := make([]byte, size) + encoding.Encode(buf, src) + stream.buf = append(stream.buf, buf...) + } stream.writeByte('"') } |