From fa514c53265e5ac1da5f192c7f19e3338b42f89c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Sun, 28 Aug 2022 21:00:23 +0200 Subject: [PATCH] blueprint: remove omitempty from Customizations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/BurntSushi/toml/issues/360 A recent change in BurntSushi/toml made encoding fail (later changed to error) if a struct is marked as omitempty and is comparable. Go docs about equality: https://go.dev/doc/go1#equality. Basically: A struct is comparable if all of its fields are comparable. Slices are not comparable. Customizations are marked as omitempty but they contain a lot of slices, thus they are not comparable. The new version of BurntSushi/toml therefore panics when we encode them. The solution is to remove the omitempty tag from Customizations. Signed-off-by: Ondřej Budai --- internal/blueprint/blueprint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/blueprint/blueprint.go b/internal/blueprint/blueprint.go index 546b3ff6a..7efc9dfed 100644 --- a/internal/blueprint/blueprint.go +++ b/internal/blueprint/blueprint.go @@ -19,7 +19,7 @@ type Blueprint struct { Modules []Package `json:"modules" toml:"modules"` Groups []Group `json:"groups" toml:"groups"` Containers []Container `json:"containers,omitempty" toml:"containers,omitempty"` - Customizations *Customizations `json:"customizations,omitempty" toml:"customizations,omitempty"` + Customizations *Customizations `json:"customizations,omitempty" toml:"customizations"` Distro string `json:"distro" toml:"distro"` }