From e78e786c14cd99fe5de2ba86dadf1fa6861384c0 Mon Sep 17 00:00:00 2001 From: James Harris Date: Thu, 11 Jul 2024 14:28:58 +1000 Subject: [PATCH] Add required `default` case to generated `Map_XXX()` and `Switch_XXX()` functions for one-of fields. --- CHANGELOG.md | 8 + go.mod | 2 +- internal/generator/exhaustiveswitch/oneof.go | 47 ++--- internal/test/exhaustiveswitch/oneof_test.go | 173 ++++++++----------- 4 files changed, 107 insertions(+), 123 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b33240b..6f37459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ The format is based on [Keep a Changelog], and this project adheres to [Keep a Changelog]: https://keepachangelog.com/en/1.0.0/ [Semantic Versioning]: https://semver.org/spec/v2.0.0.html +## [0.3.0] - 2024-07-11 + +### Changed + +- **[BC]** Added a mandatory `default_` parameter to the `Map_XXX()` and + `Switch_XXX()` functions generated for one-of fields. + ## [0.2.4] - 2024-07-11 ### Fixed @@ -105,6 +112,7 @@ The format is based on [Keep a Changelog], and this project adheres to [0.2.2]: https://github.com/dogmatiq/primo/releases/tag/v0.2.2 [0.2.3]: https://github.com/dogmatiq/primo/releases/tag/v0.2.3 [0.2.4]: https://github.com/dogmatiq/primo/releases/tag/v0.2.4 +[0.3.0]: https://github.com/dogmatiq/primo/releases/tag/v0.3.0