From 44108e58911d7265e24db64758640f6b63eaed2d Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Mon, 30 Aug 2021 12:17:18 -0700 Subject: [PATCH 1/3] Back to development --- CHANGELOG.md | 4 ++++ gen/internal/tests/collision/collision.go | 2 +- gen/internal/tests/constants/constants.go | 2 +- gen/internal/tests/containers/containers.go | 2 +- .../enum-text-marshal-strict/enum-text-marshal-strict.go | 2 +- gen/internal/tests/enum_conflict/enum_conflict.go | 2 +- gen/internal/tests/enums/enums.go | 2 +- gen/internal/tests/exceptions/exceptions.go | 2 +- gen/internal/tests/hyphenated-file/hyphenated-file.go | 2 +- gen/internal/tests/hyphenated_file/hyphenated_file.go | 2 +- gen/internal/tests/non_hyphenated/non_hyphenated.go | 2 +- gen/internal/tests/nozap/nozap.go | 2 +- gen/internal/tests/other_constants/other_constants.go | 2 +- gen/internal/tests/services/services.go | 2 +- gen/internal/tests/set_to_slice/set_to_slice.go | 2 +- gen/internal/tests/structs/structs.go | 2 +- gen/internal/tests/typedefs/typedefs.go | 2 +- gen/internal/tests/unions/unions.go | 2 +- gen/internal/tests/uuid_conflict/uuid_conflict.go | 2 +- internal/envelope/exception/exception.go | 2 +- plugin/api/api.go | 2 +- version/version.go | 2 +- 22 files changed, 25 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c184192..a45a4cf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] +- No changes yet. + ## [1.29.0] - 2021-08-30 This release includes support for (de)serializing Thrift structs directly to/from IO streams without converting them to the intermediate `wire.Value` @@ -418,6 +421,7 @@ this release. ### Added - Initial release. +[Unreleased]: https://github.com/thriftrw/thriftrw-go/compare/v1.29.0...HEAD [1.29.0]: https://github.com/thriftrw/thriftrw-go/compare/v1.28.0...v1.29.0 [1.28.0]: https://github.com/thriftrw/thriftrw-go/compare/v1.27.0...v1.28.0 [1.27.0]: https://github.com/thriftrw/thriftrw-go/compare/v1.26.0...v1.27.0 diff --git a/gen/internal/tests/collision/collision.go b/gen/internal/tests/collision/collision.go index 54a23120..3a43a248 100644 --- a/gen/internal/tests/collision/collision.go +++ b/gen/internal/tests/collision/collision.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package collision diff --git a/gen/internal/tests/constants/constants.go b/gen/internal/tests/constants/constants.go index 9d4a634f..2b7cd480 100644 --- a/gen/internal/tests/constants/constants.go +++ b/gen/internal/tests/constants/constants.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package constants diff --git a/gen/internal/tests/containers/containers.go b/gen/internal/tests/containers/containers.go index bdb8e2a0..fd0a59c1 100644 --- a/gen/internal/tests/containers/containers.go +++ b/gen/internal/tests/containers/containers.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package containers diff --git a/gen/internal/tests/enum-text-marshal-strict/enum-text-marshal-strict.go b/gen/internal/tests/enum-text-marshal-strict/enum-text-marshal-strict.go index cbcc1fe1..dd74b4e8 100644 --- a/gen/internal/tests/enum-text-marshal-strict/enum-text-marshal-strict.go +++ b/gen/internal/tests/enum-text-marshal-strict/enum-text-marshal-strict.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package enum_text_marshal_strict diff --git a/gen/internal/tests/enum_conflict/enum_conflict.go b/gen/internal/tests/enum_conflict/enum_conflict.go index 8e82e4b6..6893f7e3 100644 --- a/gen/internal/tests/enum_conflict/enum_conflict.go +++ b/gen/internal/tests/enum_conflict/enum_conflict.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package enum_conflict diff --git a/gen/internal/tests/enums/enums.go b/gen/internal/tests/enums/enums.go index 140934f5..ad430e5c 100644 --- a/gen/internal/tests/enums/enums.go +++ b/gen/internal/tests/enums/enums.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package enums diff --git a/gen/internal/tests/exceptions/exceptions.go b/gen/internal/tests/exceptions/exceptions.go index 9708bb50..c24fe897 100644 --- a/gen/internal/tests/exceptions/exceptions.go +++ b/gen/internal/tests/exceptions/exceptions.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package exceptions diff --git a/gen/internal/tests/hyphenated-file/hyphenated-file.go b/gen/internal/tests/hyphenated-file/hyphenated-file.go index 8990b73f..f17d00ae 100644 --- a/gen/internal/tests/hyphenated-file/hyphenated-file.go +++ b/gen/internal/tests/hyphenated-file/hyphenated-file.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package hyphenated_file diff --git a/gen/internal/tests/hyphenated_file/hyphenated_file.go b/gen/internal/tests/hyphenated_file/hyphenated_file.go index 3796dbc6..d9f2c8ae 100644 --- a/gen/internal/tests/hyphenated_file/hyphenated_file.go +++ b/gen/internal/tests/hyphenated_file/hyphenated_file.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package hyphenated_file diff --git a/gen/internal/tests/non_hyphenated/non_hyphenated.go b/gen/internal/tests/non_hyphenated/non_hyphenated.go index 357d8944..26fcb921 100644 --- a/gen/internal/tests/non_hyphenated/non_hyphenated.go +++ b/gen/internal/tests/non_hyphenated/non_hyphenated.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package non_hyphenated diff --git a/gen/internal/tests/nozap/nozap.go b/gen/internal/tests/nozap/nozap.go index 1a83c063..69ddbe3e 100644 --- a/gen/internal/tests/nozap/nozap.go +++ b/gen/internal/tests/nozap/nozap.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package nozap diff --git a/gen/internal/tests/other_constants/other_constants.go b/gen/internal/tests/other_constants/other_constants.go index 896f4381..5d682a65 100644 --- a/gen/internal/tests/other_constants/other_constants.go +++ b/gen/internal/tests/other_constants/other_constants.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package other_constants diff --git a/gen/internal/tests/services/services.go b/gen/internal/tests/services/services.go index 47acbf84..2bfa5e4b 100644 --- a/gen/internal/tests/services/services.go +++ b/gen/internal/tests/services/services.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package services diff --git a/gen/internal/tests/set_to_slice/set_to_slice.go b/gen/internal/tests/set_to_slice/set_to_slice.go index 62a3b72e..d2faf01a 100644 --- a/gen/internal/tests/set_to_slice/set_to_slice.go +++ b/gen/internal/tests/set_to_slice/set_to_slice.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package set_to_slice diff --git a/gen/internal/tests/structs/structs.go b/gen/internal/tests/structs/structs.go index 56beee27..6bb8d868 100644 --- a/gen/internal/tests/structs/structs.go +++ b/gen/internal/tests/structs/structs.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package structs diff --git a/gen/internal/tests/typedefs/typedefs.go b/gen/internal/tests/typedefs/typedefs.go index a3891307..7977f904 100644 --- a/gen/internal/tests/typedefs/typedefs.go +++ b/gen/internal/tests/typedefs/typedefs.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package typedefs diff --git a/gen/internal/tests/unions/unions.go b/gen/internal/tests/unions/unions.go index 6a3cba64..7c96efce 100644 --- a/gen/internal/tests/unions/unions.go +++ b/gen/internal/tests/unions/unions.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package unions diff --git a/gen/internal/tests/uuid_conflict/uuid_conflict.go b/gen/internal/tests/uuid_conflict/uuid_conflict.go index 58165a1e..df3e2e0e 100644 --- a/gen/internal/tests/uuid_conflict/uuid_conflict.go +++ b/gen/internal/tests/uuid_conflict/uuid_conflict.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated package uuid_conflict diff --git a/internal/envelope/exception/exception.go b/internal/envelope/exception/exception.go index fb1cf44c..f67e31c3 100644 --- a/internal/envelope/exception/exception.go +++ b/internal/envelope/exception/exception.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated // Copyright (c) 2021 Uber Technologies, Inc. diff --git a/plugin/api/api.go b/plugin/api/api.go index 9f748bc4..623727a7 100644 --- a/plugin/api/api.go +++ b/plugin/api/api.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.29.0. DO NOT EDIT. +// Code generated by thriftrw v1.30.0. DO NOT EDIT. // @generated // Copyright (c) 2021 Uber Technologies, Inc. diff --git a/version/version.go b/version/version.go index 7d2c8306..4a223c5b 100644 --- a/version/version.go +++ b/version/version.go @@ -21,4 +21,4 @@ package version // Version is the current ThriftRW version. -const Version = "1.29.0" +const Version = "1.30.0" From 4cb2e58ed04a4f5171ba3acbb0d81fc7a6363e3c Mon Sep 17 00:00:00 2001 From: Wit Riewrangboonya Date: Tue, 31 Aug 2021 16:28:46 -0700 Subject: [PATCH 2/3] streaming: Handle nil items in containers (#541) `nil` items should be handled gracefully similar to the Wire-based representation. Ref #183 Co-authored-by: Abhinav Gupta --- CHANGELOG.md | 3 +- gen/container_test.go | 29 ++++-- gen/internal/tests/containers/containers.go | 97 ++++++++++++++----- gen/internal/tests/services/services.go | 7 +- .../tests/set_to_slice/set_to_slice.go | 10 +- gen/internal/tests/structs/structs.go | 12 ++- gen/internal/tests/typedefs/typedefs.go | 43 ++++++-- gen/internal/tests/unions/unions.go | 12 ++- gen/list.go | 13 ++- gen/map.go | 33 ++++++- gen/set.go | 10 +- plugin/api/api.go | 29 ++++-- 12 files changed, 231 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a45a4cf5..6ecd4506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] -- No changes yet. +### Fixed +- Streaming encodes now handle `nil` items properly in containers. ## [1.29.0] - 2021-08-30 This release includes support for (de)serializing Thrift structs directly diff --git a/gen/container_test.go b/gen/container_test.go index 2bbff729..c065c893 100644 --- a/gen/container_test.go +++ b/gen/container_test.go @@ -21,12 +21,14 @@ package gen import ( + "bytes" "encoding/json" "testing" tc "go.uber.org/thriftrw/gen/internal/tests/containers" te "go.uber.org/thriftrw/gen/internal/tests/enums" ts "go.uber.org/thriftrw/gen/internal/tests/structs" + "go.uber.org/thriftrw/protocol/binary" "go.uber.org/thriftrw/wire" "github.com/stretchr/testify/assert" @@ -1278,7 +1280,7 @@ func TestContainerValidate(t *testing.T) { {4, 5, 6}, }, }, - wantError: "invalid [2]: value is nil", + wantError: "invalid list '[][]byte', index [2]: value is nil", }, { desc: "nil second element of array", @@ -1289,14 +1291,14 @@ func TestContainerValidate(t *testing.T) { {StartPoint: &ts.Point{X: 5, Y: 6}, EndPoint: &ts.Point{X: 7, Y: 8}}, }, }, - wantError: "invalid [1]: value is nil", + wantError: "invalid list '[]*Edge', index [1]: value is nil", }, { desc: "nil set item", value: &tc.ContainersOfContainers{ SetOfLists: [][]string{{}, nil}, }, - wantError: "invalid set item: value is nil", + wantError: "invalid set '[]string': contains nil value", }, { desc: "nil map key", @@ -1309,7 +1311,7 @@ func TestContainerValidate(t *testing.T) { {Key: nil, Value: "foo"}, }, }, - wantError: "invalid map key: value is nil", + wantError: "invalid map '[]struct{Key []byte; Value string}': key is nil", }, { desc: "nil map value", @@ -1319,12 +1321,12 @@ func TestContainerValidate(t *testing.T) { "foo": nil, }, }, - wantError: "invalid [foo]: value is nil", + wantError: "invalid map 'map[string][]byte', key [foo]: value is nil", }, } for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { + t.Run(tt.desc+"/wire", func(t *testing.T) { value, err := tt.value.ToWire() if err == nil { err = wire.EvaluateValue(value) // lazy error @@ -1334,6 +1336,21 @@ func TestContainerValidate(t *testing.T) { assert.Equal(t, tt.wantError, err.Error()) } }) + + t.Run(tt.desc+"/streaming", func(t *testing.T) { + stt, ok := tt.value.(streamingThriftType) + require.True(t, ok) + + var buf bytes.Buffer + sw := binary.Default.Writer(&buf) + defer func() { + assert.NoError(t, sw.Close()) + }() + + err := stt.Encode(sw) + require.Error(t, err) + assert.Equal(t, tt.wantError, err.Error()) + }) } } diff --git a/gen/internal/tests/containers/containers.go b/gen/internal/tests/containers/containers.go index fd0a59c1..e08d5441 100644 --- a/gen/internal/tests/containers/containers.go +++ b/gen/internal/tests/containers/containers.go @@ -72,7 +72,7 @@ type _List_List_I32_ValueList [][]int32 func (v _List_List_I32_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[][]int32', index [%v]: value is nil", i) } w, err := wire.NewValueList(_List_I32_ValueList(x)), error(nil) if err != nil { @@ -127,7 +127,7 @@ type _List_Set_I32_mapType_ValueList []map[int32]struct{} func (v _List_Set_I32_mapType_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[]map[int32]struct{}', index [%v]: value is nil", i) } w, err := wire.NewValueSet(_Set_I32_mapType_ValueList(x)), error(nil) if err != nil { @@ -191,7 +191,7 @@ type _List_Map_I32_I32_ValueList []map[int32]int32 func (v _List_Map_I32_I32_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[]map[int32]int32', index [%v]: value is nil", i) } w, err := wire.NewValueMap(_Map_I32_I32_MapItemList(x)), error(nil) if err != nil { @@ -246,7 +246,7 @@ type _Set_Set_String_mapType_sliceType_ValueList []map[string]struct{} func (v _Set_Set_String_mapType_sliceType_ValueList) ForEach(f func(wire.Value) error) error { for _, x := range v { if x == nil { - return fmt.Errorf("invalid set item: value is nil") + return fmt.Errorf("invalid set 'map[string]struct{}': contains nil value") } w, err := wire.NewValueSet(_Set_String_mapType_ValueList(x)), error(nil) if err != nil { @@ -301,7 +301,7 @@ type _Set_List_String_sliceType_ValueList [][]string func (v _Set_List_String_sliceType_ValueList) ForEach(f func(wire.Value) error) error { for _, x := range v { if x == nil { - return fmt.Errorf("invalid set item: value is nil") + return fmt.Errorf("invalid set '[]string': contains nil value") } w, err := wire.NewValueList(_List_String_ValueList(x)), error(nil) if err != nil { @@ -365,7 +365,7 @@ type _Set_Map_String_String_sliceType_ValueList []map[string]string func (v _Set_Map_String_String_sliceType_ValueList) ForEach(f func(wire.Value) error) error { for _, x := range v { if x == nil { - return fmt.Errorf("invalid set item: value is nil") + return fmt.Errorf("invalid set 'map[string]string': contains nil value") } w, err := wire.NewValueMap(_Map_String_String_MapItemList(x)), error(nil) if err != nil { @@ -434,7 +434,7 @@ func (m _Map_Map_String_I32_I64_MapItemList) ForEach(f func(wire.MapItem) error) k := i.Key v := i.Value if k == nil { - return fmt.Errorf("invalid map key: value is nil") + return fmt.Errorf("invalid map '[]struct{Key map[string]int32; Value int64}': key is nil") } kw, err := wire.NewValueMap(_Map_String_I32_MapItemList(k)), error(nil) if err != nil { @@ -503,10 +503,10 @@ func (m _Map_List_I32_Set_I64_mapType_MapItemList) ForEach(f func(wire.MapItem) k := i.Key v := i.Value if k == nil { - return fmt.Errorf("invalid map key: value is nil") + return fmt.Errorf("invalid map '[]struct{Key []int32; Value map[int64]struct{}}': key is nil") } if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map '[]struct{Key []int32; Value map[int64]struct{}}', key [%v]: value is nil", k) } kw, err := wire.NewValueList(_List_I32_ValueList(k)), error(nil) if err != nil { @@ -575,10 +575,10 @@ func (m _Map_Set_I32_mapType_List_Double_MapItemList) ForEach(f func(wire.MapIte k := i.Key v := i.Value if k == nil { - return fmt.Errorf("invalid map key: value is nil") + return fmt.Errorf("invalid map '[]struct{Key map[int32]struct{}; Value []float64}': key is nil") } if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map '[]struct{Key map[int32]struct{}; Value []float64}', key [%v]: value is nil", k) } kw, err := wire.NewValueSet(_Set_I32_mapType_ValueList(k)), error(nil) if err != nil { @@ -1255,7 +1255,10 @@ func _List_List_I32_Encode(val [][]int32, sw stream.Writer) error { return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[][]int32', index [%v]: value is nil", i) + } if err := _List_I32_Encode(v, sw); err != nil { return err } @@ -1293,7 +1296,10 @@ func _List_Set_I32_mapType_Encode(val []map[int32]struct{}, sw stream.Writer) er return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[]map[int32]struct{}', index [%v]: value is nil", i) + } if err := _Set_I32_mapType_Encode(v, sw); err != nil { return err } @@ -1334,7 +1340,10 @@ func _List_Map_I32_I32_Encode(val []map[int32]int32, sw stream.Writer) error { return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[]map[int32]int32', index [%v]: value is nil", i) + } if err := _Map_I32_I32_Encode(v, sw); err != nil { return err } @@ -1374,6 +1383,9 @@ func _Set_Set_String_mapType_sliceType_Encode(val []map[string]struct{}, sw stre } for _, v := range val { + if v == nil { + return fmt.Errorf("invalid set 'map[string]struct{}': contains nil value") + } if err := _Set_String_mapType_Encode(v, sw); err != nil { return err @@ -1412,6 +1424,9 @@ func _Set_List_String_sliceType_Encode(val [][]string, sw stream.Writer) error { } for _, v := range val { + if v == nil { + return fmt.Errorf("invalid set '[]string': contains nil value") + } if err := _List_String_Encode(v, sw); err != nil { return err @@ -1455,6 +1470,9 @@ func _Set_Map_String_String_sliceType_Encode(val []map[string]string, sw stream. } for _, v := range val { + if v == nil { + return fmt.Errorf("invalid set 'map[string]string': contains nil value") + } if err := _Map_String_String_Encode(v, sw); err != nil { return err @@ -1502,10 +1520,14 @@ func _Map_Map_String_I32_I64_Encode(val []struct { for _, v := range val { key := v.Key + value := v.Value + + if key == nil { + return fmt.Errorf("invalid map '[]struct{Key map[string]int32; Value int64}': key is nil") + } if err := _Map_String_I32_Encode(key, sw); err != nil { return err } - value := v.Value if err := sw.WriteInt64(value); err != nil { return err } @@ -1550,10 +1572,17 @@ func _Map_List_I32_Set_I64_mapType_Encode(val []struct { for _, v := range val { key := v.Key + value := v.Value + + if key == nil { + return fmt.Errorf("invalid map '[]struct{Key []int32; Value map[int64]struct{}}': key is nil") + } + if value == nil { + return fmt.Errorf("invalid map '[]struct{Key []int32; Value map[int64]struct{}}', key [%v]: value is nil", key) + } if err := _List_I32_Encode(key, sw); err != nil { return err } - value := v.Value if err := _Set_I64_mapType_Encode(value, sw); err != nil { return err } @@ -1596,10 +1625,17 @@ func _Map_Set_I32_mapType_List_Double_Encode(val []struct { for _, v := range val { key := v.Key + value := v.Value + + if key == nil { + return fmt.Errorf("invalid map '[]struct{Key map[int32]struct{}; Value []float64}': key is nil") + } + if value == nil { + return fmt.Errorf("invalid map '[]struct{Key map[int32]struct{}; Value []float64}', key [%v]: value is nil", key) + } if err := _Set_I32_mapType_Encode(key, sw); err != nil { return err } - value := v.Value if err := _List_Double_Encode(value, sw); err != nil { return err } @@ -4660,7 +4696,7 @@ type _List_UUID_ValueList []*typedefs.UUID func (v _List_UUID_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[]*typedefs.UUID', index [%v]: value is nil", i) } w, err := x.ToWire() if err != nil { @@ -4863,7 +4899,10 @@ func _List_UUID_Encode(val []*typedefs.UUID, sw stream.Writer) error { return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[]*typedefs.UUID', index [%v]: value is nil", i) + } if err := v.Encode(sw); err != nil { return err } @@ -5613,7 +5652,7 @@ func (m _Map_Binary_String_MapItemList) ForEach(f func(wire.MapItem) error) erro k := i.Key v := i.Value if k == nil { - return fmt.Errorf("invalid map key: value is nil") + return fmt.Errorf("invalid map '[]struct{Key []byte; Value string}': key is nil") } kw, err := wire.NewValueBinary(k), error(nil) if err != nil { @@ -5651,7 +5690,7 @@ type _Map_String_Binary_MapItemList map[string][]byte func (m _Map_String_Binary_MapItemList) ForEach(f func(wire.MapItem) error) error { for k, v := range m { if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map 'map[string][]byte', key [%v]: value is nil", k) } kw, err := wire.NewValueString(k), error(nil) if err != nil { @@ -5852,10 +5891,14 @@ func _Map_Binary_String_Encode(val []struct { for _, v := range val { key := v.Key + value := v.Value + + if key == nil { + return fmt.Errorf("invalid map '[]struct{Key []byte; Value string}': key is nil") + } if err := sw.WriteBinary(key); err != nil { return err } - value := v.Value if err := sw.WriteString(value); err != nil { return err } @@ -5876,6 +5919,9 @@ func _Map_String_Binary_Encode(val map[string][]byte, sw stream.Writer) error { } for k, v := range val { + if v == nil { + return fmt.Errorf("invalid map 'map[string][]byte', key [%v]: value is nil", k) + } if err := sw.WriteString(k); err != nil { return err } @@ -6257,7 +6303,7 @@ type _List_Binary_ValueList [][]byte func (v _List_Binary_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[][]byte', index [%v]: value is nil", i) } w, err := wire.NewValueBinary(x), error(nil) if err != nil { @@ -6675,7 +6721,10 @@ func _List_Binary_Encode(val [][]byte, sw stream.Writer) error { return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[][]byte', index [%v]: value is nil", i) + } if err := sw.WriteBinary(v); err != nil { return err } diff --git a/gen/internal/tests/services/services.go b/gen/internal/tests/services/services.go index 2bfa5e4b..f9a9cbca 100644 --- a/gen/internal/tests/services/services.go +++ b/gen/internal/tests/services/services.go @@ -2621,7 +2621,7 @@ type _List_ArbitraryValue_ValueList []*unions.ArbitraryValue func (v _List_ArbitraryValue_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[]*unions.ArbitraryValue', index [%v]: value is nil", i) } w, err := x.ToWire() if err != nil { @@ -2781,7 +2781,10 @@ func _List_ArbitraryValue_Encode(val []*unions.ArbitraryValue, sw stream.Writer) return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[]*unions.ArbitraryValue', index [%v]: value is nil", i) + } if err := v.Encode(sw); err != nil { return err } diff --git a/gen/internal/tests/set_to_slice/set_to_slice.go b/gen/internal/tests/set_to_slice/set_to_slice.go index d2faf01a..cbb89919 100644 --- a/gen/internal/tests/set_to_slice/set_to_slice.go +++ b/gen/internal/tests/set_to_slice/set_to_slice.go @@ -167,7 +167,7 @@ type _Set_Foo_sliceType_ValueList []*Foo func (v _Set_Foo_sliceType_ValueList) ForEach(f func(wire.Value) error) error { for _, x := range v { if x == nil { - return fmt.Errorf("invalid set item: value is nil") + return fmt.Errorf("invalid set '*Foo': contains nil value") } w, err := x.ToWire() if err != nil { @@ -196,7 +196,7 @@ type _Set_Set_String_sliceType_sliceType_ValueList [][]string func (v _Set_Set_String_sliceType_sliceType_ValueList) ForEach(f func(wire.Value) error) error { for _, x := range v { if x == nil { - return fmt.Errorf("invalid set item: value is nil") + return fmt.Errorf("invalid set '[]string': contains nil value") } w, err := wire.NewValueSet(_Set_String_sliceType_ValueList(x)), error(nil) if err != nil { @@ -628,6 +628,9 @@ func _Set_Foo_sliceType_Encode(val []*Foo, sw stream.Writer) error { } for _, v := range val { + if v == nil { + return fmt.Errorf("invalid set '*Foo': contains nil value") + } if err := v.Encode(sw); err != nil { return err @@ -648,6 +651,9 @@ func _Set_Set_String_sliceType_sliceType_Encode(val [][]string, sw stream.Writer } for _, v := range val { + if v == nil { + return fmt.Errorf("invalid set '[]string': contains nil value") + } if err := _Set_String_sliceType_Encode(v, sw); err != nil { return err diff --git a/gen/internal/tests/structs/structs.go b/gen/internal/tests/structs/structs.go index 6bb8d868..9757c58f 100644 --- a/gen/internal/tests/structs/structs.go +++ b/gen/internal/tests/structs/structs.go @@ -3069,7 +3069,7 @@ type _List_Edge_ValueList []*Edge func (v _List_Edge_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[]*Edge', index [%v]: value is nil", i) } w, err := x.ToWire() if err != nil { @@ -3196,7 +3196,10 @@ func _List_Edge_Encode(val []*Edge, sw stream.Writer) error { return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[]*Edge', index [%v]: value is nil", i) + } if err := v.Encode(sw); err != nil { return err } @@ -7871,7 +7874,7 @@ type _Map_String_User_MapItemList map[string]*User func (m _Map_String_User_MapItemList) ForEach(f func(wire.MapItem) error) error { for k, v := range m { if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map 'map[string]*User', key [%v]: value is nil", k) } kw, err := wire.NewValueString(k), error(nil) if err != nil { @@ -7916,6 +7919,9 @@ func _Map_String_User_Encode(val map[string]*User, sw stream.Writer) error { } for k, v := range val { + if v == nil { + return fmt.Errorf("invalid map 'map[string]*User', key [%v]: value is nil", k) + } if err := sw.WriteString(k); err != nil { return err } diff --git a/gen/internal/tests/typedefs/typedefs.go b/gen/internal/tests/typedefs/typedefs.go index 7977f904..42faf8e0 100644 --- a/gen/internal/tests/typedefs/typedefs.go +++ b/gen/internal/tests/typedefs/typedefs.go @@ -23,7 +23,7 @@ type _Set_Binary_sliceType_ValueList [][]byte func (v _Set_Binary_sliceType_ValueList) ForEach(f func(wire.Value) error) error { for _, x := range v { if x == nil { - return fmt.Errorf("invalid set item: value is nil") + return fmt.Errorf("invalid set '[]byte': contains nil value") } w, err := wire.NewValueBinary(x), error(nil) if err != nil { @@ -59,6 +59,9 @@ func _Set_Binary_sliceType_Encode(val [][]byte, sw stream.Writer) error { } for _, v := range val { + if v == nil { + return fmt.Errorf("invalid set '[]byte': contains nil value") + } if err := sw.WriteBinary(v); err != nil { return err @@ -464,10 +467,10 @@ func (m _Map_Edge_Edge_MapItemList) ForEach(f func(wire.MapItem) error) error { k := i.Key v := i.Value if k == nil { - return fmt.Errorf("invalid map key: value is nil") + return fmt.Errorf("invalid map '[]struct{Key *structs.Edge; Value *structs.Edge}': key is nil") } if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map '[]struct{Key *structs.Edge; Value *structs.Edge}', key [%v]: value is nil", k) } kw, err := k.ToWire() if err != nil { @@ -516,10 +519,17 @@ func _Map_Edge_Edge_Encode(val []struct { for _, v := range val { key := v.Key + value := v.Value + + if key == nil { + return fmt.Errorf("invalid map '[]struct{Key *structs.Edge; Value *structs.Edge}': key is nil") + } + if value == nil { + return fmt.Errorf("invalid map '[]struct{Key *structs.Edge; Value *structs.Edge}', key [%v]: value is nil", key) + } if err := key.Encode(sw); err != nil { return err } - value := v.Value if err := value.Encode(sw); err != nil { return err } @@ -1074,7 +1084,7 @@ type _List_Event_ValueList []*Event func (v _List_Event_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[]*Event', index [%v]: value is nil", i) } w, err := x.ToWire() if err != nil { @@ -1108,7 +1118,10 @@ func _List_Event_Encode(val []*Event, sw stream.Writer) error { return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[]*Event', index [%v]: value is nil", i) + } if err := v.Encode(sw); err != nil { return err } @@ -1254,7 +1267,7 @@ type _Set_Frame_sliceType_ValueList []*structs.Frame func (v _Set_Frame_sliceType_ValueList) ForEach(f func(wire.Value) error) error { for _, x := range v { if x == nil { - return fmt.Errorf("invalid set item: value is nil") + return fmt.Errorf("invalid set '*structs.Frame': contains nil value") } w, err := x.ToWire() if err != nil { @@ -1290,6 +1303,9 @@ func _Set_Frame_sliceType_Encode(val []*structs.Frame, sw stream.Writer) error { } for _, v := range val { + if v == nil { + return fmt.Errorf("invalid set '*structs.Frame': contains nil value") + } if err := v.Encode(sw); err != nil { return err @@ -1599,10 +1615,10 @@ func (m _Map_Point_Point_MapItemList) ForEach(f func(wire.MapItem) error) error k := i.Key v := i.Value if k == nil { - return fmt.Errorf("invalid map key: value is nil") + return fmt.Errorf("invalid map '[]struct{Key *structs.Point; Value *structs.Point}': key is nil") } if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map '[]struct{Key *structs.Point; Value *structs.Point}', key [%v]: value is nil", k) } kw, err := k.ToWire() if err != nil { @@ -1651,10 +1667,17 @@ func _Map_Point_Point_Encode(val []struct { for _, v := range val { key := v.Key + value := v.Value + + if key == nil { + return fmt.Errorf("invalid map '[]struct{Key *structs.Point; Value *structs.Point}': key is nil") + } + if value == nil { + return fmt.Errorf("invalid map '[]struct{Key *structs.Point; Value *structs.Point}', key [%v]: value is nil", key) + } if err := key.Encode(sw); err != nil { return err } - value := v.Value if err := value.Encode(sw); err != nil { return err } diff --git a/gen/internal/tests/unions/unions.go b/gen/internal/tests/unions/unions.go index 7c96efce..f3fd9acb 100644 --- a/gen/internal/tests/unions/unions.go +++ b/gen/internal/tests/unions/unions.go @@ -37,7 +37,7 @@ type _List_ArbitraryValue_ValueList []*ArbitraryValue func (v _List_ArbitraryValue_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[]*ArbitraryValue', index [%v]: value is nil", i) } w, err := x.ToWire() if err != nil { @@ -66,7 +66,7 @@ type _Map_String_ArbitraryValue_MapItemList map[string]*ArbitraryValue func (m _Map_String_ArbitraryValue_MapItemList) ForEach(f func(wire.MapItem) error) error { for k, v := range m { if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map 'map[string]*ArbitraryValue', key [%v]: value is nil", k) } kw, err := wire.NewValueString(k), error(nil) if err != nil { @@ -326,7 +326,10 @@ func _List_ArbitraryValue_Encode(val []*ArbitraryValue, sw stream.Writer) error return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[]*ArbitraryValue', index [%v]: value is nil", i) + } if err := v.Encode(sw); err != nil { return err } @@ -346,6 +349,9 @@ func _Map_String_ArbitraryValue_Encode(val map[string]*ArbitraryValue, sw stream } for k, v := range val { + if v == nil { + return fmt.Errorf("invalid map 'map[string]*ArbitraryValue', key [%v]: value is nil", k) + } if err := sw.WriteString(k); err != nil { return err } diff --git a/gen/list.go b/gen/list.go index fcd07cb6..62feb4d3 100644 --- a/gen/list.go +++ b/gen/list.go @@ -60,7 +60,7 @@ func (l *listGenerator) ValueList(g Generator, spec *compile.ListSpec) (string, <- else -> for <$i>, <$x> := range <$v> { if <$x> == nil { - return .Errorf("invalid [%v]: value is nil", <$i>) + return .Errorf("invalid list '', index [%v]: value is nil", <$i>) } <- end> <$w>, err := @@ -156,11 +156,12 @@ func (l *listGenerator) Encoder(g Generator, spec *compile.ListSpec) (string, er <$listType := typeReference .Spec> <$sw := newVar "sw"> <$lh := newVar "lh"> + <$i := newVar "i"> <$o := newVar "o"> <$k := newVar "k"> <$v := newVar "v"> <$val := newVar "val"> - func <.Name>(<$val> <$listType>, <$sw> <$stream>.Writer) error { + func <.Name>(<$val> <$listType>, <$sw> <$stream>.Writer) error { <$vt := typeCode .Spec.ValueSpec> <$lh> := <$stream>.ListHeader{ Type: <$vt>, @@ -170,7 +171,15 @@ func (l *listGenerator) Encoder(g Generator, spec *compile.ListSpec) (string, er return err } + for _, <$v> := range <$val> { + <- else -> + for <$i>, <$v> := range <$val> { + if <$v> == nil { + return .Errorf("invalid list '', index [%v]: value is nil", <$i>) + } + + if err := ; err != nil { return err } diff --git a/gen/map.go b/gen/map.go index 51d7a42f..f261a341 100644 --- a/gen/map.go +++ b/gen/map.go @@ -70,12 +70,12 @@ func (m *mapGenerator) ItemList(g Generator, spec *compile.MapSpec) (string, err <- if not (isPrimitiveType .Spec.KeySpec) -> if <$k> == nil { - return .Errorf("invalid map key: value is nil") + return .Errorf("invalid map '': key is nil") } <- if not (isPrimitiveType .Spec.ValueSpec) -> if <$v> == nil { - return .Errorf("invalid [%v]: value is nil", <$k>) + return .Errorf("invalid map '', key [%v]: value is nil", <$k>) } @@ -203,7 +203,7 @@ func (m *mapGenerator) Encoder(g Generator, spec *compile.MapSpec) (string, erro <$value := newVar "value"> func <.Name>(<$val> <$mapType>, <$sw> <$stream>.Writer) error { <$kt := typeCode .Spec.KeySpec> - <$vt := typeCode .Spec.ValueSpec> + <$vt := typeCode .Spec.ValueSpec> <$mh> := <$stream>.MapHeader{ KeyType: <$kt>, ValueType: <$vt>, @@ -215,20 +215,43 @@ func (m *mapGenerator) Encoder(g Generator, spec *compile.MapSpec) (string, erro for <$k>, <$v> := range <$val> { + <- if not (isPrimitiveType .Spec.KeySpec) -> + if <$k> == nil { + return .Errorf("invalid map '': key is nil") + } + + <- if not (isPrimitiveType .Spec.ValueSpec) -> + if <$v> == nil { + return .Errorf("invalid map '', key [%v]: value is nil", <$k>) + } + + if err := ; err != nil { return err } if err := ; err != nil { return err } - } + } for _, <$v> := range <$val> { <$key> := + <$value> := + + + if <$key> == nil { + return .Errorf("invalid map '': key is nil") + } + + <- if not (isPrimitiveType .Spec.ValueSpec) -> + if <$value> == nil { + return .Errorf("invalid map '', key [%v]: value is nil", <$key>) + } + + if err := ; err != nil { return err } - <$value> := if err := ; err != nil { return err } diff --git a/gen/set.go b/gen/set.go index abce3c50..fc760460 100644 --- a/gen/set.go +++ b/gen/set.go @@ -61,7 +61,7 @@ func (s *setGenerator) ValueList(g Generator, spec *compile.SetSpec) (string, er <- end -> if <$x> == nil { - return .Errorf("invalid set item: value is nil") + return .Errorf("invalid set '': contains nil value") } @@ -155,7 +155,7 @@ func (s *setGenerator) Encoder(g Generator, spec *compile.SetSpec) (string, erro <$k := newVar "k"> <$v := newVar "v"> <$val := newVar "val"> - func <.Name>(<$val> <$setType>, <$sw> <$stream>.Writer) error { + func <.Name>(<$val> <$setType>, <$sw> <$stream>.Writer) error { <$vt := typeCode .Spec.ValueSpec> <$sh> := <$stream>.SetHeader{ Type: <$vt>, @@ -171,6 +171,12 @@ func (s *setGenerator) Encoder(g Generator, spec *compile.SetSpec) (string, erro for _, <$v> := range <$val> { + <- if not (isPrimitiveType .Spec.ValueSpec) -> + if <$v> == nil { + return .Errorf("invalid set '': contains nil value") + } + <- end> + if err := ; err != nil { return err } diff --git a/plugin/api/api.go b/plugin/api/api.go index 623727a7..23e15550 100644 --- a/plugin/api/api.go +++ b/plugin/api/api.go @@ -803,7 +803,7 @@ type _List_Argument_ValueList []*Argument func (v _List_Argument_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[]*Argument', index [%v]: value is nil", i) } w, err := x.ToWire() if err != nil { @@ -1042,7 +1042,10 @@ func _List_Argument_Encode(val []*Argument, sw stream.Writer) error { return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[]*Argument', index [%v]: value is nil", i) + } if err := v.Encode(sw); err != nil { return err } @@ -1575,7 +1578,7 @@ type _Map_ServiceID_Service_MapItemList map[ServiceID]*Service func (m _Map_ServiceID_Service_MapItemList) ForEach(f func(wire.MapItem) error) error { for k, v := range m { if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map 'map[ServiceID]*Service', key [%v]: value is nil", k) } kw, err := k.ToWire() if err != nil { @@ -1613,7 +1616,7 @@ type _Map_ModuleID_Module_MapItemList map[ModuleID]*Module func (m _Map_ModuleID_Module_MapItemList) ForEach(f func(wire.MapItem) error) error { for k, v := range m { if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map 'map[ModuleID]*Module', key [%v]: value is nil", k) } kw, err := k.ToWire() if err != nil { @@ -1993,6 +1996,9 @@ func _Map_ServiceID_Service_Encode(val map[ServiceID]*Service, sw stream.Writer) } for k, v := range val { + if v == nil { + return fmt.Errorf("invalid map 'map[ServiceID]*Service', key [%v]: value is nil", k) + } if err := k.Encode(sw); err != nil { return err } @@ -2016,6 +2022,9 @@ func _Map_ModuleID_Module_Encode(val map[ModuleID]*Module, sw stream.Writer) err } for k, v := range val { + if v == nil { + return fmt.Errorf("invalid map 'map[ModuleID]*Module', key [%v]: value is nil", k) + } if err := k.Encode(sw); err != nil { return err } @@ -2701,7 +2710,7 @@ type _Map_String_Binary_MapItemList map[string][]byte func (m _Map_String_Binary_MapItemList) ForEach(f func(wire.MapItem) error) error { for k, v := range m { if v == nil { - return fmt.Errorf("invalid [%v]: value is nil", k) + return fmt.Errorf("invalid map 'map[string][]byte', key [%v]: value is nil", k) } kw, err := wire.NewValueString(k), error(nil) if err != nil { @@ -2845,6 +2854,9 @@ func _Map_String_Binary_Encode(val map[string][]byte, sw stream.Writer) error { } for k, v := range val { + if v == nil { + return fmt.Errorf("invalid map 'map[string][]byte', key [%v]: value is nil", k) + } if err := sw.WriteString(k); err != nil { return err } @@ -4147,7 +4159,7 @@ type _List_Function_ValueList []*Function func (v _List_Function_ValueList) ForEach(f func(wire.Value) error) error { for i, x := range v { if x == nil { - return fmt.Errorf("invalid [%v]: value is nil", i) + return fmt.Errorf("invalid list '[]*Function', index [%v]: value is nil", i) } w, err := x.ToWire() if err != nil { @@ -4375,7 +4387,10 @@ func _List_Function_Encode(val []*Function, sw stream.Writer) error { return err } - for _, v := range val { + for i, v := range val { + if v == nil { + return fmt.Errorf("invalid list '[]*Function', index [%v]: value is nil", i) + } if err := v.Encode(sw); err != nil { return err } From f7066fbc46d149718f60e3b128214b47acfb7413 Mon Sep 17 00:00:00 2001 From: Wit Riewrangboonya Date: Tue, 31 Aug 2021 16:42:55 -0700 Subject: [PATCH 3/3] Preparing release v1.29.1 --- CHANGELOG.md | 4 ++-- gen/internal/tests/collision/collision.go | 2 +- gen/internal/tests/constants/constants.go | 2 +- gen/internal/tests/containers/containers.go | 2 +- .../enum-text-marshal-strict/enum-text-marshal-strict.go | 2 +- gen/internal/tests/enum_conflict/enum_conflict.go | 2 +- gen/internal/tests/enums/enums.go | 2 +- gen/internal/tests/exceptions/exceptions.go | 2 +- gen/internal/tests/hyphenated-file/hyphenated-file.go | 2 +- gen/internal/tests/hyphenated_file/hyphenated_file.go | 2 +- gen/internal/tests/non_hyphenated/non_hyphenated.go | 2 +- gen/internal/tests/nozap/nozap.go | 2 +- gen/internal/tests/other_constants/other_constants.go | 2 +- gen/internal/tests/services/services.go | 2 +- gen/internal/tests/set_to_slice/set_to_slice.go | 2 +- gen/internal/tests/structs/structs.go | 2 +- gen/internal/tests/typedefs/typedefs.go | 2 +- gen/internal/tests/unions/unions.go | 2 +- gen/internal/tests/uuid_conflict/uuid_conflict.go | 2 +- internal/envelope/exception/exception.go | 2 +- plugin/api/api.go | 2 +- version/version.go | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ecd4506..cafeb9fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.29.1] - 2021-08-31 ### Fixed - Streaming encodes now handle `nil` items properly in containers. @@ -422,7 +422,7 @@ this release. ### Added - Initial release. -[Unreleased]: https://github.com/thriftrw/thriftrw-go/compare/v1.29.0...HEAD +[1.29.1]: https://github.com/thriftrw/thriftrw-go/compare/v1.29.0...v1.29.1 [1.29.0]: https://github.com/thriftrw/thriftrw-go/compare/v1.28.0...v1.29.0 [1.28.0]: https://github.com/thriftrw/thriftrw-go/compare/v1.27.0...v1.28.0 [1.27.0]: https://github.com/thriftrw/thriftrw-go/compare/v1.26.0...v1.27.0 diff --git a/gen/internal/tests/collision/collision.go b/gen/internal/tests/collision/collision.go index 3a43a248..cdf19a08 100644 --- a/gen/internal/tests/collision/collision.go +++ b/gen/internal/tests/collision/collision.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package collision diff --git a/gen/internal/tests/constants/constants.go b/gen/internal/tests/constants/constants.go index 2b7cd480..4d41d3f3 100644 --- a/gen/internal/tests/constants/constants.go +++ b/gen/internal/tests/constants/constants.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package constants diff --git a/gen/internal/tests/containers/containers.go b/gen/internal/tests/containers/containers.go index e08d5441..09553cf8 100644 --- a/gen/internal/tests/containers/containers.go +++ b/gen/internal/tests/containers/containers.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package containers diff --git a/gen/internal/tests/enum-text-marshal-strict/enum-text-marshal-strict.go b/gen/internal/tests/enum-text-marshal-strict/enum-text-marshal-strict.go index dd74b4e8..419288c0 100644 --- a/gen/internal/tests/enum-text-marshal-strict/enum-text-marshal-strict.go +++ b/gen/internal/tests/enum-text-marshal-strict/enum-text-marshal-strict.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package enum_text_marshal_strict diff --git a/gen/internal/tests/enum_conflict/enum_conflict.go b/gen/internal/tests/enum_conflict/enum_conflict.go index 6893f7e3..e27a0127 100644 --- a/gen/internal/tests/enum_conflict/enum_conflict.go +++ b/gen/internal/tests/enum_conflict/enum_conflict.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package enum_conflict diff --git a/gen/internal/tests/enums/enums.go b/gen/internal/tests/enums/enums.go index ad430e5c..e4d985ed 100644 --- a/gen/internal/tests/enums/enums.go +++ b/gen/internal/tests/enums/enums.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package enums diff --git a/gen/internal/tests/exceptions/exceptions.go b/gen/internal/tests/exceptions/exceptions.go index c24fe897..b88742ff 100644 --- a/gen/internal/tests/exceptions/exceptions.go +++ b/gen/internal/tests/exceptions/exceptions.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package exceptions diff --git a/gen/internal/tests/hyphenated-file/hyphenated-file.go b/gen/internal/tests/hyphenated-file/hyphenated-file.go index f17d00ae..96e9825a 100644 --- a/gen/internal/tests/hyphenated-file/hyphenated-file.go +++ b/gen/internal/tests/hyphenated-file/hyphenated-file.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package hyphenated_file diff --git a/gen/internal/tests/hyphenated_file/hyphenated_file.go b/gen/internal/tests/hyphenated_file/hyphenated_file.go index d9f2c8ae..47736de7 100644 --- a/gen/internal/tests/hyphenated_file/hyphenated_file.go +++ b/gen/internal/tests/hyphenated_file/hyphenated_file.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package hyphenated_file diff --git a/gen/internal/tests/non_hyphenated/non_hyphenated.go b/gen/internal/tests/non_hyphenated/non_hyphenated.go index 26fcb921..36cffb7f 100644 --- a/gen/internal/tests/non_hyphenated/non_hyphenated.go +++ b/gen/internal/tests/non_hyphenated/non_hyphenated.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package non_hyphenated diff --git a/gen/internal/tests/nozap/nozap.go b/gen/internal/tests/nozap/nozap.go index 69ddbe3e..5a661cdf 100644 --- a/gen/internal/tests/nozap/nozap.go +++ b/gen/internal/tests/nozap/nozap.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package nozap diff --git a/gen/internal/tests/other_constants/other_constants.go b/gen/internal/tests/other_constants/other_constants.go index 5d682a65..568354b7 100644 --- a/gen/internal/tests/other_constants/other_constants.go +++ b/gen/internal/tests/other_constants/other_constants.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package other_constants diff --git a/gen/internal/tests/services/services.go b/gen/internal/tests/services/services.go index f9a9cbca..5d06595e 100644 --- a/gen/internal/tests/services/services.go +++ b/gen/internal/tests/services/services.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package services diff --git a/gen/internal/tests/set_to_slice/set_to_slice.go b/gen/internal/tests/set_to_slice/set_to_slice.go index cbb89919..ead828df 100644 --- a/gen/internal/tests/set_to_slice/set_to_slice.go +++ b/gen/internal/tests/set_to_slice/set_to_slice.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package set_to_slice diff --git a/gen/internal/tests/structs/structs.go b/gen/internal/tests/structs/structs.go index 9757c58f..86b2c94d 100644 --- a/gen/internal/tests/structs/structs.go +++ b/gen/internal/tests/structs/structs.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package structs diff --git a/gen/internal/tests/typedefs/typedefs.go b/gen/internal/tests/typedefs/typedefs.go index 42faf8e0..ef388599 100644 --- a/gen/internal/tests/typedefs/typedefs.go +++ b/gen/internal/tests/typedefs/typedefs.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package typedefs diff --git a/gen/internal/tests/unions/unions.go b/gen/internal/tests/unions/unions.go index f3fd9acb..e9195d27 100644 --- a/gen/internal/tests/unions/unions.go +++ b/gen/internal/tests/unions/unions.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package unions diff --git a/gen/internal/tests/uuid_conflict/uuid_conflict.go b/gen/internal/tests/uuid_conflict/uuid_conflict.go index df3e2e0e..214e4518 100644 --- a/gen/internal/tests/uuid_conflict/uuid_conflict.go +++ b/gen/internal/tests/uuid_conflict/uuid_conflict.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated package uuid_conflict diff --git a/internal/envelope/exception/exception.go b/internal/envelope/exception/exception.go index f67e31c3..56c25f84 100644 --- a/internal/envelope/exception/exception.go +++ b/internal/envelope/exception/exception.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated // Copyright (c) 2021 Uber Technologies, Inc. diff --git a/plugin/api/api.go b/plugin/api/api.go index 23e15550..bdc6117a 100644 --- a/plugin/api/api.go +++ b/plugin/api/api.go @@ -1,4 +1,4 @@ -// Code generated by thriftrw v1.30.0. DO NOT EDIT. +// Code generated by thriftrw v1.29.1. DO NOT EDIT. // @generated // Copyright (c) 2021 Uber Technologies, Inc. diff --git a/version/version.go b/version/version.go index 4a223c5b..c21d54d6 100644 --- a/version/version.go +++ b/version/version.go @@ -21,4 +21,4 @@ package version // Version is the current ThriftRW version. -const Version = "1.30.0" +const Version = "1.29.1"