Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move all the business logic of parsing and generating code into maker subpackage. Instead of functions, the maker package exports a Maker struct, which has two exported methods: ParseSource to add a file, and MakeInterface to create the interface. The struct now handles the data that was previously handled by the main package between the invocation of the two functions. Don't use token.Pos to access source file byte slice, this doesn't work when there are multiple files in the fileset. Use go/printer or directly get the parsed strings from the ast nodes. Ignore dot imports, assume they will not be needed by the generated struct. Throw errors when aliases conflict or a package is imported with different aliases (vburenin#9). Add a "Code generated by" comment per https://golang.org/s/generatedcode Add tests + travis.
- Loading branch information