vburenin / ifacemaker

Generate interfaces from structure methods.
Apache License 2.0
320 stars 43 forks source link

Adds flag to skip re-import by target package name. #32

Closed mkraft closed 5 years ago

mkraft commented 5 years ago

Importing to the same target package name as one of the imported types in the source implementation struct can lead to an import cycle in the generated code. There's a simple example in the added tests. This PR adds a new optional flag -N/--import-same-name which — if left unset — will behave the same as usual, but allows users with the outlined scenario to use this tool.