Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.26 KB

README.md

File metadata and controls

48 lines (36 loc) · 1.26 KB

modmerge

A command line tool for merging multiple go.mod files into a single file.

Useful when combining projects or making an "uber module" for projects which use the multiple module repository pattern.

Installation

go get -u github.com/brendanjryan/modmerge

Usage

Default:

modmerge <go.mod files...>

To specify an output file:

modmerge -o go.mod.new go.mod services/user/go.mod services/tweets/go.mod

Example

$ modmerge go.mod project/go.mod
2019/10/06 14:34:29 reading module files...
2019/10/06 14:34:29 reading file: go.mod
2019/10/06 14:34:29 reading file: project/go.mod
2019/10/06 14:34:29 merging module files...
2019/10/06 14:34:29 writng final result to go.mod.new...
2019/10/06 14:34:29 Successfully wrote merged modules to go.mod.new
$ modmerge -o go.mod.merged go.mod project/go.mod
2019/10/06 14:34:29 reading module files...
2019/10/06 14:34:29 reading file: go.mod
2019/10/06 14:34:29 reading file: project/go.mod
2019/10/06 14:34:29 merging module files...
2019/10/06 14:34:29 writng final result to go.mod.merged...
2019/10/06 14:34:29 Successfully wrote merged modules to go.mod.merged