diff options
author | Zhaozhong Ni <nzz@google.com> | 2018-08-03 12:07:57 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-08-03 12:09:13 -0700 |
commit | 25178ebdf5e881eae8e81eaf2f69d96de42d2250 (patch) | |
tree | c56769ea375733dfdcc70ac68cf5c1c45fb9baa8 /tools/go_stateify/main.go | |
parent | a3927157c56cc022cefebc30c8a9b6014f5d0412 (diff) |
stateify: make explicit mode no longer optional.
PiperOrigin-RevId: 207303405
Change-Id: I17b6433963d78e3631a862b7ac80f566c8e7d106
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) |