| 425 | } |
| 426 | |
| 427 | func (fs *FileSet) PrintTo(p *gen.Printer) error { |
| 428 | fs.applyDirs(p) |
| 429 | names := make([]string, 0, len(fs.Identities)) |
| 430 | for name := range fs.Identities { |
| 431 | names = append(names, name) |
| 432 | } |
| 433 | sort.Strings(names) |
| 434 | for _, name := range names { |
| 435 | el := fs.Identities[name] |
| 436 | el.SetVarname("z") |
| 437 | pushstate(el.TypeName()) |
| 438 | err := p.Print(el) |
| 439 | popstate() |
| 440 | if err != nil { |
| 441 | return err |
| 442 | } |
| 443 | } |
| 444 | return nil |
| 445 | } |
| 446 | |
| 447 | // getTypeSpecs extracts all of the *ast.TypeSpecs in the file |
| 448 | // into fs.Identities, but does not set the actual element |