Go to file
Jeff Carr 3adf184a4a validate versions before running go get 2025-01-08 04:07:53 -06:00
.gitignore missing ignore 2024-12-13 21:05:54 -06:00
LICENSE Day 1 2024-12-10 14:07:14 -06:00
Makefile don't work on non-master branches 2024-12-13 16:16:18 -06:00
README.md store go.mod and go.sum in git. thank you most excellent git devs 2024-12-13 12:34:47 -06:00
argv.go add --purge to get rid of all notes 2024-12-18 01:29:07 -06:00
cleanGoSum.go validate versions before running go get 2025-01-08 04:07:53 -06:00
control rename as go-mod-clean 2024-12-12 18:59:16 -06:00
doForce.go fixes for new gitpb 2024-12-17 07:03:07 -06:00
doSmart.go more positive verbage 2025-01-07 17:16:38 -06:00
doStrict.go oops. go mod tidy makes the go.sum file 2024-12-18 22:02:19 -06:00
exit.go add --strict for release management purposes 2024-12-14 18:45:29 -06:00
main.go probably wrong 2024-12-18 03:34:58 -06:00
notes.go add --purge to get rid of all notes 2024-12-18 01:29:07 -06:00
redoGoMod.go oops. go mod tidy makes the go.sum file 2024-12-18 22:02:19 -06:00
restore.go always restore from last tag 2024-12-18 20:24:02 -06:00
run.go parse out the required golang version 2024-12-18 00:41:52 -06:00
stdin.go add --purge to get rid of all notes 2024-12-18 01:29:07 -06:00

README.md

go-mod-clean

This is a hack to experiement with trimming unused entries from the go.sum files. Since go.sum files need to be recursively processed, this attempts to remove unused entries. There are all sorts of real world reasons on why this needs to be done sometimes.

  • go-mod-clean tries to remove uneeded entries from the go.sum file.
  • You must run go-mod-clean in ~/go/src for this to work.
  • stores go.mod and go.sum with autogen:go.mod tags in 'git notes'

Install go-mod-clean

go install go.wit.com/apps/go-mod-clean@latest

How it works

go-mod-clean is very simple. It will run 'go build' with GO111MODULE=off. In this mode, go will compile directly based on the 'import' paths. It simply parses the errors from 'go build' and makes sure the appropriate entries are in the go.sum file.

Thats it!