(cmd *cobra.Command, group string)
| 59 | } |
| 60 | |
| 61 | func runEditGroup(cmd *cobra.Command, group string) error { |
| 62 | opts, err := assignCreateGroupOptions(cmd) |
| 63 | if err != nil { |
| 64 | return err |
| 65 | } |
| 66 | gid, err := strconv.Atoi(group) |
| 67 | // if group is not a number, |
| 68 | // search for the group path's id and assign it to gid |
| 69 | if err != nil { |
| 70 | gid, err = getGroupID(group) |
| 71 | if err != nil { |
| 72 | return fmt.Errorf("couldn't find the id of group %s, got error: %v", |
| 73 | group, err) |
| 74 | } |
| 75 | } |
| 76 | editedGroup, err := editGroup(gid, (*gitlab.UpdateGroupOptions)(opts)) |
| 77 | if err != nil { |
| 78 | return err |
| 79 | } |
| 80 | printGroupsOut(getFlagString(cmd, "out"), editedGroup) |
| 81 | return nil |
| 82 | } |
| 83 | |
| 84 | func editGroup(gid int, opts *gitlab.UpdateGroupOptions) (*gitlab.Group, error) { |
| 85 | git, err := newGitlabClient() |
no test coverage detected