If you have a module that has another module as a dependency, but that 2nd module isn't in a repo, how do you package/distribute the 1st module?
From what I understand, you have 2 options:
replace
directive in go.mod to point to a local folder and then vendor the 2nd module.Obviously the 1st option is the only reasonable one, but if so:
Based on what I can gather, Go doesn't support the importing of other modules locally unless you use replace
and then include it twice, once in a subfolder and again in the vendor folder.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.