booklit
booklit copied to clipboard
better handling of --plugin and go.mod
getting errors like this when adding --plugin github.com/vito/booklit/chroma/plugin:
❯ ./scripts/build -s 3001
INFO[0000] plugin registered plugin=baselit
../../../go/pkg/mod/github.com/vito/[email protected]/chroma/booklit_lexer.go:4:2: missing go.sum entry for module providing package github.com/alecthomas/chroma; to add:
go mod download github.com/alecthomas/chroma
../../../go/pkg/mod/github.com/vito/[email protected]/chroma/plugin.go:26:2: missing go.sum entry for module providing package github.com/alecthomas/chroma/formatters/html; to add:
go mod download github.com/alecthomas/chroma
../../../go/pkg/mod/github.com/vito/[email protected]/chroma/booklit_lexer.go:5:2: missing go.sum entry for module providing package github.com/alecthomas/chroma/lexers; to add:
go mod download github.com/alecthomas/chroma
../../../go/pkg/mod/github.com/vito/[email protected]/chroma/plugin.go:28:2: missing go.sum entry for module providing package github.com/alecthomas/chroma/styles; to add:
go mod download github.com/alecthomas/chroma
build failed: exit status 1
maybe --plugin can automatically add things to go.mod? unfortunately go mod tidy will clean that out. maybe there's some way to flag it? 🤔
maybe plugins should be enabled with a .go file that underscore-imports them?
The later is the only way we were able to do it here.