https://github.com/jehiah/gomodimports
Like goimports but for keeping a tidy go.mod file
https://github.com/jehiah/gomodimports
gomod stylelint
Last synced: about 1 year ago
JSON representation
Like goimports but for keeping a tidy go.mod file
- Host: GitHub
- URL: https://github.com/jehiah/gomodimports
- Owner: jehiah
- Created: 2020-03-11T02:20:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-20T14:31:26.000Z (about 2 years ago)
- Last Synced: 2025-01-24T17:31:58.279Z (over 1 year ago)
- Topics: gomod, stylelint
- Language: Go
- Size: 13.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## gomodimports
Like `goimports` but for keeping a tidy go.mod file
```
$ gomodimports -w -f go.mod
```
Takes an ugly go mod file
```
module myrepo.com/package
go 1.13
require vcs.com/pkg/testing v1.5.1
replace (
// comment about pkg/testing
vcs.com/pkg/testing => ../testing
)
require (
vcs.com/other-packages v0.0.0
)
```
and turns it inoto a go.mod file with a single `require` and `replace` block preserving comments.
```
module myrepo.com/package
go 1.13
require (
vcs.com/other-packages v0.0.0
vcs.com/pkg/testing v1.5.1
)
// comment about pkg/testing
replace vcs.com/pkg/testing => ../testing
```