You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users should add new elements to this kind of Map with the helper Add function that checks if the map is empty or not before adding a new value.
Anyway we can create a generic function for that as Golang 1.19 is out. Golang 1.17 is not supported anymore so we may assume downstream projects to use at least Golang v1.18.x
Hello guys, sorry for joining the discussion here 🙏 .
how about on LoadService we add the process to initialize the CustomLabel to the empty value of map[string]string instead of leaving it nil ?
because most who use this compose-go library call it in loader.Load(). so when loader.Load() return the Project type the value of Service.CustomLabel not nil but already initialize.
Description
The
Project
andService
objects returned by this library oftenconfuse users because certain fields are not always initialized.
For example,
CustomLabels
(amap[string]string
) will benil
on each
Service
.Potential Solutions
NewProject
andNewService
constructors that initializeall fields consistently
AddCustomLabel
that internally handleinitialization lazily
Related Issues
docker/compose#9808
The text was updated successfully, but these errors were encountered: