diff --git a/pkg/lang/golang/plugin_fs.go b/pkg/lang/golang/plugin_fs.go index ea97e528a..3e681af0e 100644 --- a/pkg/lang/golang/plugin_fs.go +++ b/pkg/lang/golang/plugin_fs.go @@ -99,10 +99,16 @@ func (p *PersistFsPlugin) transformFS(f *core.SourceFile, cap *core.Annotation, newNodeContent := strings.Replace(result.args.Content(), result.args.Content(), ArgumentListToString(args), 1) - f.ReplaceNodeContent(result.args, newNodeContent) - f.ReplaceNodeContent(result.operator, "blob") + err := f.ReplaceNodeContent(result.args, newNodeContent) + if err != nil { + return nil, err + } + err = f.ReplaceNodeContent(result.operator, "blob") + if err != nil { + return nil, err + } - err := UpdateImportsInFile(f, p.runtime.GetFsImports(), []Import{{Package: "gocloud.dev/blob/fileblob"}}) + err = UpdateImportsInFile(f, p.runtime.GetFsImports(), []Import{{Package: "gocloud.dev/blob/fileblob"}}) if err != nil { return nil, err } diff --git a/pkg/lang/golang/queries/gocloud/mem_bucket.scm b/pkg/lang/golang/queries/gocloud/mem_bucket.scm deleted file mode 100644 index 3eadfcae0..000000000 --- a/pkg/lang/golang/queries/gocloud/mem_bucket.scm +++ /dev/null @@ -1,17 +0,0 @@ -(short_var_declaration - left: (expression_list - (identifier) @varName - ) @variables - right: (expression_list - (call_expression - function: (selector_expression - operand: (identifier) @id - field: (field_identifier) @method - ) - arguments: (argument_list) @args - (#match? @method "OpenBucket") - ) - ) -)@expression - -;; bucket, err := fileblob.OpenBucket(myDir, myConnector)