@@ -138,15 +138,15 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *alb.APIClie
138138 return req .CreateLoadBalancerPayload (payload ), nil
139139}
140140
141- func readPayload (ctx context.Context , model * inputModel ) (payload alb.CreateLoadBalancerPayload , err error ) {
141+ func readPayload (_ context.Context , model * inputModel ) (payload alb.CreateLoadBalancerPayload , err error ) {
142142 if model .Configuration == nil {
143143 return payload , fmt .Errorf ("no configuration file defined" )
144144 }
145145 file , err := os .Open (* model .Configuration )
146146 if err != nil {
147147 return payload , fmt .Errorf ("cannot open configuration file %q: %w" , * model .Configuration , err )
148148 }
149- defer file .Close ()
149+ defer file .Close () // nolint:errcheck // at this point close errors are not relevant anymore
150150
151151 if strings .HasSuffix (* model .Configuration , ".yaml" ) {
152152 decoder := yaml .NewDecoder (bufio .NewReader (file ), yaml .UseJSONUnmarshaler ())
@@ -159,7 +159,7 @@ func readPayload(ctx context.Context, model *inputModel) (payload alb.CreateLoad
159159 return payload , fmt .Errorf ("cannot deserialize json configuration from %q: %w" , * model .Configuration , err )
160160 }
161161 } else {
162- return payload , fmt .Errorf ("cannot determine configuration fileformat of %q by extension. Must be '.json' or '.yaml'" , err )
162+ return payload , fmt .Errorf ("cannot determine configuration fileformat of %q by extension. Must be '.json' or '.yaml'" , * model . Configuration )
163163 }
164164
165165 return payload , nil
0 commit comments