@@ -134,14 +134,15 @@ func parseNameAndVersion(in string) (string, string, bool) {
134134 return split [0 ][1 ], split [0 ][2 ], true
135135}
136136
137+ // UnmarshalYAML decodes a ProfilePlatformReference from YAML source.
137138func (p * ProfilePlatformReference ) UnmarshalYAML (unmarshal func (interface {}) error ) error {
138139 var data map [string ]string
139140 if err := unmarshal (& data ); err != nil {
140141 return err
141142 }
142- if platformId , ok := data ["platform" ]; ! ok {
143+ if platformID , ok := data ["platform" ]; ! ok {
143144 return fmt .Errorf (tr ("missing 'platform' directive" ))
144- } else if platformId , platformVersion , ok := parseNameAndVersion (platformId ); ! ok {
145+ } else if platformId , platformVersion , ok := parseNameAndVersion (platformID ); ! ok {
145146 return fmt .Errorf (tr ("invalid 'platform' directive" ))
146147 } else if c , err := semver .Parse (platformVersion ); err != nil {
147148 return fmt .Errorf ("%s: %w" , tr ("error parsing version constraints" ), err )
@@ -154,11 +155,11 @@ func (p *ProfilePlatformReference) UnmarshalYAML(unmarshal func(interface{}) err
154155 }
155156
156157 if rawIndexURL , ok := data ["platform_index_url" ]; ok {
157- if indexURL , err := url .Parse (rawIndexURL ); err != nil {
158+ indexURL , err := url .Parse (rawIndexURL )
159+ if err != nil {
158160 return fmt .Errorf ("%s: %w" , tr ("invlid platform index URL:" ), err )
159- } else {
160- p .PlatformIndexURL = indexURL
161161 }
162+ p .PlatformIndexURL = indexURL
162163 }
163164 return nil
164165}
@@ -169,6 +170,7 @@ type ProfileLibraryReference struct {
169170 Version * semver.Version
170171}
171172
173+ // UnmarshalYAML decodes a ProfileLibraryReference from YAML source.
172174func (l * ProfileLibraryReference ) UnmarshalYAML (unmarshal func (interface {}) error ) error {
173175 var data string
174176 if err := unmarshal (& data ); err != nil {
0 commit comments