Go to file
Jeff Carr e90127b54a attempt hacky fix 2024-12-13 20:31:55 -06:00
.gitignore Day 1 2024-12-10 14:07:14 -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
all.go save and restore from git notes 2024-12-13 02:21:25 -06:00
argv.go save and restore from git notes 2024-12-13 02:21:25 -06:00
cleanGoSum.go attempt hacky fix 2024-12-13 20:31:55 -06:00
control rename as go-mod-clean 2024-12-12 18:59:16 -06:00
exit.go don't work on non-master branches 2024-12-13 16:16:18 -06:00
isTracked.go better logic for valid go.mod files 2024-12-13 18:59:40 -06:00
main.go attempt hacky fix 2024-12-13 20:31:55 -06:00
redoGoMod.go don't work on non-master branches 2024-12-13 16:16:18 -06:00
run.go don't work on non-master branches 2024-12-13 16:16:18 -06:00
stdin.go don't work on non-master branches 2024-12-13 16:16:18 -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!