holos-run / holos

Holos - The Holistic platform manager
https://holos.run
Apache License 2.0
19 stars 0 forks source link

use go:generate and commit all results (#192) #193

Closed jeffmccune closed 4 months ago

jeffmccune commented 4 months ago

Previously go install fails to install holos.

❯ go install github.com/holos-run/holos/cmd/holos@latest
../../go/pkg/mod/github.com/holos-run/holos@v0.86.0/internal/frontend/frontend.go:25:12: pattern holos/dist/holos/ui/index.html: no matching files found
../../go/pkg/mod/github.com/holos-run/holos@v0.86.0/doc/website/website.go:14:12: pattern all:build: no matching files found

This is because we do not commit required files. This patch fixes the problem by following Rob Pike's guidance to commit generated files. This patch also replaces the previous use of Makefile tasks to generate code with //go:generate directives.

This means the process of keeping the source code clean is straight forward:

git clone
make tools
make generate
make build

Refer to https://go.dev/blog/generate

Also, if the containing package is intended for import by go get, once the file is generated (and tested!) it must be checked into the source code repository to be available to clients. - Rob Pike

Closes: #192