From 81316d3eefdd0abac38ceb09a458b834986ecf04 Mon Sep 17 00:00:00 2001 From: Chrstopher Hunter <8398225+crhntr@users.noreply.github.com> Date: Tue, 20 Aug 2024 18:11:57 -0700 Subject: [PATCH] fix warnings --- cmd/muxt/generate.go | 2 +- internal/source/ast.go | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cmd/muxt/generate.go b/cmd/muxt/generate.go index d362098..961fd15 100644 --- a/cmd/muxt/generate.go +++ b/cmd/muxt/generate.go @@ -68,7 +68,7 @@ func newGenerate(args []string, getEnv func(string) string) (Generate, error) { return g, nil } -func generateCommand(args []string, workingDirectory string, getEnv func(string) string, stdout, stderr io.Writer) error { +func generateCommand(args []string, workingDirectory string, getEnv func(string) string, stdout, _ /* stderr */ io.Writer) error { g, err := newGenerate(args, getEnv) if err != nil { return err diff --git a/internal/source/ast.go b/internal/source/ast.go index f088a96..f39b191 100644 --- a/internal/source/ast.go +++ b/internal/source/ast.go @@ -74,23 +74,23 @@ func IterateFunctions(files []*ast.File) func(func(*ast.File, *ast.FuncDecl) boo } } -func IterateImports(files []*ast.File) func(func(*ast.File, *ast.ImportSpec) bool) { - return func(yield func(*ast.File, *ast.ImportSpec) bool) { - for _, file := range files { - for _, decl := range file.Decls { - genDecl, ok := decl.(*ast.GenDecl) - if !ok || genDecl.Tok != token.IMPORT { - continue - } - for _, s := range genDecl.Specs { - if !yield(file, s.(*ast.ImportSpec)) { - return - } - } - } - } - } -} +//func IterateImports(files []*ast.File) func(func(*ast.File, *ast.ImportSpec) bool) { +// return func(yield func(*ast.File, *ast.ImportSpec) bool) { +// for _, file := range files { +// for _, decl := range file.Decls { +// genDecl, ok := decl.(*ast.GenDecl) +// if !ok || genDecl.Tok != token.IMPORT { +// continue +// } +// for _, s := range genDecl.Specs { +// if !yield(file, s.(*ast.ImportSpec)) { +// return +// } +// } +// } +// } +// } +//} func Format(node ast.Node) string { var buf strings.Builder