MCPcopy Index your code
hub / github.com/devopsctl/gitlabctl / runEditGroup

Function runEditGroup

cmd/edit_group.go:61–82  ·  view source on GitHub ↗
(cmd *cobra.Command, group string)

Source from the content-addressed store, hash-verified

59}
60
61func 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
84func editGroup(gid int, opts *gitlab.UpdateGroupOptions) (*gitlab.Group, error) {
85 git, err := newGitlabClient()

Callers 1

edit_group.goFile · 0.85

Calls 5

assignCreateGroupOptionsFunction · 0.85
getGroupIDFunction · 0.85
editGroupFunction · 0.85
printGroupsOutFunction · 0.85
getFlagStringFunction · 0.85

Tested by

no test coverage detected