Go to file
Jeff Carr 8130ffd25b lame oversight on my part 2025-01-30 14:11:45 -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 maybe, finally, release logic works 2025-01-29 20:42:49 -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
doRestore.go rename 2025-01-29 19:59:42 -06:00
doSmart.go maybe, finally, release logic works 2025-01-29 20:42:49 -06:00
doStrict.go lame oversight on my part 2025-01-30 14:11:45 -06:00
exit.go add --strict for release management purposes 2024-12-14 18:45:29 -06:00
main.go dump errors that were never tested 2025-01-30 13:35:01 -06:00
notes.go add --purge to get rid of all notes 2024-12-18 01:29:07 -06:00
redoGoMod.go just name fixups 2025-01-30 01:47:46 -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!