printer: output build tags in stubs file

Updates #3
This commit is contained in:
Michael McLoughlin
2019-01-02 22:01:38 -08:00
parent 75224ed031
commit 36984c7031

View File

@@ -16,6 +16,12 @@ func NewStubs(cfg Config) Printer {
func (s *stubs) Print(f *avo.File) ([]byte, error) { func (s *stubs) Print(f *avo.File) ([]byte, error) {
s.Comment(s.cfg.GeneratedWarning()) s.Comment(s.cfg.GeneratedWarning())
if len(f.Constraints) > 0 {
s.NL()
s.Printf(f.Constraints.GoString())
}
s.NL() s.NL()
s.Printf("package %s\n", s.cfg.Pkg) s.Printf("package %s\n", s.cfg.Pkg)
for _, fn := range f.Functions() { for _, fn := range f.Functions() {