Replace google/go-licenses with custom generation (#36575)

Rewrite `build/generate-go-licenses.go` to use `go list -m -json all`
and read license files directly from the Go module cache instead of
relying on the buggy `google/go-licenses` tool.

This removes the need for CGO, GOOS=linux, and the intermediate temp
directory, while being like 100 times faster than before:

```
$ rm assets/go-licenses.json && time make assets/go-licenses.json
go run build/generate-go-licenses.go assets/go-licenses.json
make assets/go-licenses.json  0.21s user 0.22s system 173% cpu 0.247 total

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
silverwindandClaude Opus 4.6 authored and GitHub committed 2026-02-18 04:13:26 +00:00
1 parent 2cb8f6a9a5
commit b9d323c3d8
4 files changed
+262 -130

No files matched your search

-1
View File
@@ -89,7 +89,6 @@ cpu.out
/vendor
/VERSION
/.air
/.go-licenses
# Files and folders that were previously generated
/public/assets/img/webpack