withReleaseURLs swaps checksumsURL and releaseBase for one test; safe only because these tests don't run in parallel.
(t *testing.T, base string)
| 45 | // withReleaseURLs swaps checksumsURL and releaseBase for one test; safe only |
| 46 | // because these tests don't run in parallel. |
| 47 | func withReleaseURLs(t *testing.T, base string) { |
| 48 | t.Helper() |
| 49 | origCS := checksumsURL |
| 50 | origBase := releaseBase |
| 51 | checksumsURL = base + "/codehamr_checksums.txt" |
| 52 | releaseBase = base + "/" |
| 53 | t.Cleanup(func() { |
| 54 | checksumsURL = origCS |
| 55 | releaseBase = origBase |
| 56 | }) |
| 57 | } |
| 58 | |
| 59 | // hashOf returns the sha256 hex digest, matching goreleaser's manifest format. |
| 60 | func hashOf(body []byte) string { |
no outgoing calls
no test coverage detected