Pathsym *obj.LSym
Prefix string // escaped path for use in symbol table
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
}
}
// process header lines
+ safe := false
for {
p, err = imp.ReadString('\n')
if err != nil {
break // header ends with blank line
}
if strings.HasPrefix(p, "safe") {
- importpkg.Safe = true
+ safe = true
break // ok to ignore rest
}
}
+ if safemode && !safe {
+ Yyerror("cannot import unsafe package %q", importpkg.Path)
+ }
// assume files move (get installed)
// so don't record the full path.
Yyerror("no import in %q", path_)
errorexit()
}
-
- if safemode && !importpkg.Safe {
- Yyerror("cannot import unsafe package %q", importpkg.Path)
- }
}
func pkgnotused(lineno int32, path string, name string) {