File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 44 "archive/zip"
55 "bytes"
66 "encoding/json"
7+ "errors"
78 "fmt"
89 "log"
910 "os"
@@ -143,13 +144,14 @@ func (s *AwsCloudfrontUpdateCmd) Run() error {
143144 FunctionName : aws .String (s .Function ),
144145 })
145146 if err != nil {
146- if aerr , ok := err .(awserr.Error ); ok && aerr .Code () != lambda .ErrCodeResourceNotFoundException {
147+ var aerr awserr.Error
148+ if errors .As (err , & aerr ) && aerr .Code () != lambda .ErrCodeResourceNotFoundException {
147149 return fmt .Errorf ("cannot find lambda function %q: %w" , s .Function , err )
148150 }
149151 _ , err = svc .CreateFunction (& lambda.CreateFunctionInput {
150152 FunctionName : aws .String (s .Function ),
151153 })
152- if aerr , ok := err .(awserr. Error ); ok && aerr .Code () != lambda .ErrCodeResourceConflictException {
154+ if errors . As ( err , & aerr ) && aerr .Code () != lambda .ErrCodeResourceConflictException {
153155 return err
154156 }
155157 }
You can’t perform that action at this time.
0 commit comments