check / check (push) Waiting to run
script/lint-darwin (make lint-darwin; run by script/check, and its commands by the Dockerfile lint stage) runs go vet and golangci-lint with GOOS=darwin and cgo off. Compiling cgo for macOS needs Apple's SDK, so the three functions that call go-keychain, which is cgo there, move to keychainunlocker_cgo.go; a macOS build without cgo gets keychainunlocker_nocgo.go and the macse stub, whose errors name the missing macOS build with cgo. The rest of the keychain unlocker and its plain-Go tests are now checked; their findings are fixed without changing behaviour, and lines over 88 columns in the unchecked files are wrapped. Model: opus-5-5
29 lines
800 B
Go
29 lines
800 B
Go
//go:build !darwin || !cgo
|
|
|
|
// Package macse provides Go bindings for macOS Secure Enclave operations.
|
|
package macse
|
|
|
|
import "errors"
|
|
|
|
var errNotSupported = errors.New("secure enclave needs a macOS build with cgo")
|
|
|
|
// CreateKey fails: the Secure Enclave needs a macOS build with cgo.
|
|
func CreateKey(_ string) ([]byte, string, error) {
|
|
return nil, "", errNotSupported
|
|
}
|
|
|
|
// Encrypt fails: the Secure Enclave needs a macOS build with cgo.
|
|
func Encrypt(_ string, _ []byte) ([]byte, error) {
|
|
return nil, errNotSupported
|
|
}
|
|
|
|
// Decrypt fails: the Secure Enclave needs a macOS build with cgo.
|
|
func Decrypt(_ string, _ []byte) ([]byte, error) {
|
|
return nil, errNotSupported
|
|
}
|
|
|
|
// DeleteKey fails: the Secure Enclave needs a macOS build with cgo.
|
|
func DeleteKey(_ string) error {
|
|
return errNotSupported
|
|
}
|