Convert Pkg.Imported, Pkg.Exported, Pkg.Direct from uint8/int8/int8 to bool.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: I67a71f1186ff9737c03eca413f7d35d8a79ebc9b
Reviewed-on: https://go-review.googlesource.com/14371
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
}
func dumppkg(p *Pkg) {
- if p == nil || p == localpkg || p.Exported != 0 || p == builtinpkg {
+ if p == nil || p == localpkg || p.Exported || p == builtinpkg {
return
}
- p.Exported = 1
+ p.Exported = true
suffix := ""
- if p.Direct == 0 {
+ if !p.Direct {
suffix = " // indirect"
}
fmt.Fprintf(bout, "\timport %s %q%s\n", p.Name, p.Path, suffix)
fmt.Fprintf(bout, "\n")
for _, p := range pkgs {
- if p.Direct != 0 {
+ if p.Direct {
dumppkg(p)
}
}
Path string // string literal used in import statement
Pathsym *Sym
Prefix string // escaped path for use in symbol table
- Imported uint8 // export data of this package was parsed
- Exported int8 // import line written in export data
- Direct int8 // imported directly
+ Imported bool // export data of this package was parsed
+ Exported bool // import line written in export data
+ Direct bool // imported directly
Safe bool // whether the package is marked as safe
Syms map[string]*Sym
}
} else if importpkg.Name != $2.Name {
Yyerror("conflicting names %s and %s for package %q", importpkg.Name, $2.Name, importpkg.Path);
}
- importpkg.Direct = 1;
+ importpkg.Direct = true;
importpkg.Safe = curio.importsafe
if safemode != 0 && !curio.importsafe {
// If we already saw that package, feed a dummy statement
// to the lexer to avoid parsing export data twice.
- if importpkg.Imported != 0 {
+ if importpkg.Imported {
tag := ""
if importpkg.Safe {
tag = "safe"
return
}
- importpkg.Imported = 1
+ importpkg.Imported = true
var err error
var imp *obj.Biobuf
// generate import strings for imported packages
for _, p := range pkgs {
- if p.Direct != 0 {
+ if p.Direct {
dimportpath(p)
}
}
} else if importpkg.Name != yyDollar[2].sym.Name {
Yyerror("conflicting names %s and %s for package %q", importpkg.Name, yyDollar[2].sym.Name, importpkg.Path)
}
- importpkg.Direct = 1
+ importpkg.Direct = true
importpkg.Safe = curio.importsafe
if safemode != 0 && !curio.importsafe {