cl/convert:mod instead OutputDir in Package #346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Package修改为接受gopmod.Module替代当前的OutputDir在Package中的耦合,目前Package应该负责的是gogen.Package的构建,而之前的OutputDir会导致Package需要额外关心怎么去加载这个Mod以及Catch一些Error,但实际上这个原子能力应该只去关心怎么使用这个go.Mod带来的能力,而修改为gopmod.Module,调用者也可以更灵活的创建模块。The Package should currently be responsible for building gogen.Package, while the previous OutputDir would require Package to additionally handle how to load this Mod and catch some errors. In fact, this atomic capability should only focus on how to use the capabilities provided by go.Mod. By changing to gopmod.Module, the caller can also more flexibly create the module.