transaction: Do not make Transaction to implement error interface anymore

As per previous commit, Transaction can't be used anymore as an error
value, but we instead we always return the status code.
This commit is contained in:
Marco Trevisan (Treviño)
2023-10-11 12:21:35 +02:00
parent adffdfbbdc
commit 7162004668
2 changed files with 1 additions and 7 deletions

View File

@@ -126,8 +126,6 @@ func cbPAMConv(s C.int, msg *C.char, c C.uintptr_t) (*C.char, C.int) {
} }
// Transaction is the application's handle for a PAM transaction. // Transaction is the application's handle for a PAM transaction.
//
//nolint:errname
type Transaction struct { type Transaction struct {
handle *C.pam_handle_t handle *C.pam_handle_t
conv *C.struct_pam_conv conv *C.struct_pam_conv
@@ -217,10 +215,6 @@ func start(service, user string, handler ConversationHandler, confDir string) (*
return t, nil return t, nil
} }
func (t *Transaction) Error() string {
return Error(t.lastStatus.Load()).Error()
}
// Item is a an PAM information type. // Item is a an PAM information type.
type Item int type Item int

View File

@@ -512,7 +512,7 @@ func Test_Error(t *testing.T) {
if err != nil { if err != nil {
var status Error var status Error
if !errors.As(err, &status) || err.Error() != status.Error() { if !errors.As(err, &status) || err.Error() != status.Error() {
t.Fatalf("error #unexpected status %v vs %v", err.Error(), t.Fatalf("error #unexpected status %#v vs %#v", err.Error(),
status.Error()) status.Error())
} }
} }