- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for removeEmptyDeclGroups (0.28 sec)
-
src/cmd/gofmt/simplify.go
ident, ok := x.(*ast.Ident) return ok && ident.Name == "_" } func simplify(f *ast.File) { // remove empty declarations such as "const ()", etc removeEmptyDeclGroups(f) var s simplifier ast.Walk(s, f) } func removeEmptyDeclGroups(f *ast.File) { i := 0 for _, d := range f.Decls { if g, ok := d.(*ast.GenDecl); !ok || !isEmpty(f, g) { f.Decls[i] = d i++ } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 19 20:06:14 UTC 2022 - 4.8K bytes - Viewed (0)