slsa-github-generator
slsa-github-generator copied to clipboard
[bug] second argument to errors.As should not be *error
This message pops up when running unit tests.
github/oidc_test.go:237:10: second argument to errors.As should not be *error
Is this just a transient error? (From the rate limiting issue?)
I tried a couple of re-runs, but haven't hit it yet
EDIT: or maybe it's a go version? That doesn't seem like it would be a rate limiting error
This isn't an error per se as it doesn't stop and it's not an error in the Rekor client or anything so it shouldn't be any thing with rate limiting. It's just a log message that I think the stdlib spits out. It happens in tests and I'm not totally sure but I'm pretty sure it's not transient. I think it's just some test code that calls errors.As on an error pointer.
I found the issue. It only happens on Go 1.19+ and strangely it only seems to happen in the one file oidc_test.go. Other test files use the same code and types but don't produce this error message. I'm not sure why.
I don't know why this code would trigger the error: https://github.com/slsa-framework/slsa-github-generator/blob/1f9352cda9cb1c5454adc2a2b25c05298be0d57c/github/oidc_test.go#L237-L239
But this code won't: https://github.com/slsa-framework/slsa-github-generator/blob/1f9352cda9cb1c5454adc2a2b25c05298be0d57c/internal/builders/generic/attest_test.go#L140-L142
Related to:
- #782
- #970