internal/pkg: update http checksum signature
All checks were successful
Test / Create distribution (push) Successful in 55s
Test / Sandbox (push) Successful in 3m7s
Test / Sandbox (race detector) (push) Successful in 5m45s
Test / ShareFS (push) Successful in 5m47s
Test / Hpkg (push) Successful in 6m13s
Test / Hakurei (push) Successful in 7m6s
Test / Hakurei (race detector) (push) Successful in 8m38s
Test / Flake checks (push) Successful in 1m41s

This was using the old pre-KnownChecksum function signature. It did not affect correctness since httpArtifact performs internal validation to avoid the strict mode vfs roundtrip, but it prevented content-addressed cache hits.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-06 18:24:31 +09:00
parent 0741a614ed
commit ceb75538cf

View File

@@ -32,6 +32,8 @@ type httpArtifact struct {
mu sync.Mutex
}
var _ KnownChecksum = new(httpArtifact)
// NewHTTPGet returns a new [File] backed by the supplied client. A GET request
// is set up for url. If c is nil, [http.DefaultClient] is used instead.
func NewHTTPGet(
@@ -59,8 +61,8 @@ func (a *httpArtifact) Params() []byte { return []byte(a.url) }
// Dependencies returns a nil slice.
func (a *httpArtifact) Dependencies() []Artifact { return nil }
// Checksum returns the address to the caller-supplied checksum.
func (a *httpArtifact) Checksum() *Checksum { return &a.checksum }
// Checksum returns the caller-supplied checksum.
func (a *httpArtifact) Checksum() Checksum { return a.checksum }
// ResponseStatusError is returned for a response returned by an [http.Client]
// with a status code other than [http.StatusOK].