We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27960c8 commit d58a12cCopy full SHA for d58a12c
pkg/cid/cid.go
@@ -11,6 +11,7 @@ import (
11
"encoding/hex"
12
"encoding/pem"
13
"fmt"
14
+ "slices"
15
16
"github.com/hyperledger/fabric-chaincode-go/v2/pkg/attrmgr"
17
"github.com/hyperledger/fabric-protos-go-apiv2/msp"
@@ -143,12 +144,7 @@ func (c *ClientID) HasOUValue(OUValue string) (bool, error) {
143
144
return false, fmt.Errorf("cannot obtain an X509 certificate for the identity")
145
}
146
- for _, OU := range x509Cert.Subject.OrganizationalUnit {
147
- if OU == OUValue {
148
- return true, nil
149
- }
150
151
- return false, nil
+ return slices.Contains(x509Cert.Subject.OrganizationalUnit, OUValue), nil
152
153
154
// GetX509Certificate returns the X509 certificate associated with the client,
0 commit comments