Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr committed Aug 21, 2024
1 parent 885c93c commit 81316d3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cmd/muxt/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 17 additions & 17 deletions internal/source/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81316d3

Please sign in to comment.