fix: Ignore staticcheck false positive on darwin (#28038)

This commit is contained in:
Alan Parra 2023-06-19 15:42:10 -03:00 committed by GitHub
parent 6ed1a58e1f
commit ec8594f96d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -57,7 +57,9 @@ func SolveTPMAuthnDeviceChallenge(challenge *devicepb.TPMAuthenticateDeviceChall
// HandleTPMActivateCredential completes the credential activation part of an
// enrollment challenge. This is usually called in an elevated process that's
// created by SolveTPMEnrollChallenge.
func HandleTPMActivateCredential(encryptedCredential string, encryptedCredentialSecret string) error {
//
//nolint:staticcheck // HandleTPMActivateCredential works depending on the platform.
func HandleTPMActivateCredential(encryptedCredential, encryptedCredentialSecret string) error {
return handleTPMActivateCredential(encryptedCredential, encryptedCredentialSecret)
}

View file

@ -166,9 +166,11 @@ type deviceActivateCredentialCommand struct {
}
func (c *deviceActivateCredentialCommand) run(cf *CLIConf) error {
//nolint:staticcheck // HandleTPMActivateCredential works depending on the platform.
err := dtnative.HandleTPMActivateCredential(
c.encryptedCredential, c.encryptedCredentialSecret,
)
//nolint:staticcheck // `err` can indeed be nil.
if cf.Debug && err != nil {
// On error, wait for user input before executing. This is because this
// opens in a second window. If we return the error immediately, then