From 21909d4cf88d5c220997d6772301fc23a5a593d3 Mon Sep 17 00:00:00 2001 From: Jordan Singer Date: Wed, 8 Feb 2023 14:13:53 -0600 Subject: [PATCH] remove membucket query --- pkg/lang/golang/plugin_fs.go | 12 +++++++++--- pkg/lang/golang/queries/gocloud/mem_bucket.scm | 17 ----------------- 2 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 pkg/lang/golang/queries/gocloud/mem_bucket.scm 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)