Get the membership entry associated to the current user for the given organization
(ctx context.Context, name string)
| 25 | |
| 26 | // Get the membership entry associated to the current user for the given organization |
| 27 | func membershipFromOrg(ctx context.Context, name string) (*action.MembershipItem, error) { |
| 28 | memberships, err := action.NewMembershipList(ActionOpts).ListOrgs(ctx) |
| 29 | if err != nil { |
| 30 | return nil, fmt.Errorf("listing memberships: %w", err) |
| 31 | } |
| 32 | |
| 33 | for _, m := range memberships { |
| 34 | if m.Org.Name == name { |
| 35 | return m, nil |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | return nil, fmt.Errorf("organization %s not found", name) |
| 40 | } |
| 41 | |
| 42 | func newOrganizationLeaveCmd() *cobra.Command { |
| 43 | var orgName string |
no test coverage detected