diff options
Diffstat (limited to 'tools/go_stateify/main.go')
-rw-r--r-- | tools/go_stateify/main.go | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/tools/go_stateify/main.go b/tools/go_stateify/main.go index 231c6d80b..5646b879a 100644 --- a/tools/go_stateify/main.go +++ b/tools/go_stateify/main.go @@ -33,7 +33,6 @@ var ( imports = flag.String("imports", "", "extra imports for the output file") output = flag.String("output", "", "output file") statePkg = flag.String("statepkg", "", "state import package; defaults to empty") - explicit = flag.Bool("explicit", false, "only generate for types explicitly tagged '// +stateify savable'") ) // resolveTypeName returns a qualified type name. @@ -318,25 +317,22 @@ func main() { continue } - if *explicit { - // In explicit mode, only generate code for - // types explicitly marked - // "// +stateify savable" in one of the - // proceeding comment lines. - if d.Doc == nil { - continue - } - savable := false - for _, l := range d.Doc.List { - if l.Text == "// +stateify savable" { - savable = true - break - } - } - if !savable { - continue + // Only generate code for types marked + // "// +stateify savable" in one of the proceeding + // comment lines. + if d.Doc == nil { + continue + } + savable := false + for _, l := range d.Doc.List { + if l.Text == "// +stateify savable" { + savable = true + break } } + if !savable { + continue + } for _, gs := range d.Specs { ts := gs.(*ast.TypeSpec) |