Skip to content

Commit

Permalink
stub: update setIdentify to ensureIdentify
Browse files Browse the repository at this point in the history
Signed-off-by: Iceber Gu <[email protected]>
  • Loading branch information
Iceber committed May 18, 2023
1 parent 2a8b655 commit a67478e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/stub/stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func New(p interface{}, opts ...Option) (Stub, error) {
return nil, err
}

if err := stub.getIdentity(); err != nil {
if err := stub.ensureIdentity(); err != nil {
return nil, err
}

Expand Down Expand Up @@ -678,8 +678,8 @@ func (stub *stub) StateChange(ctx context.Context, evt *api.StateChangeEvent) (*
return &api.StateChangeResponse{}, err
}

// getIdentity gets plugin index and name from the binary if those are unset.
func (stub *stub) getIdentity() error {
// ensureIdentity sets plugin index and name from the binary if those are unset.
func (stub *stub) ensureIdentity() error {
if stub.idx != "" && stub.name != "" {
return nil
}
Expand Down

0 comments on commit a67478e

Please sign in to comment.