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

Function deleteGroup

cmd/delete_group.go:56–77  ·  view source on GitHub ↗
(group string)

Source from the content-addressed store, hash-verified

54}
55
56func deleteGroup(group string) error {
57 git, err := newGitlabClient()
58 if err != nil {
59 return err
60 }
61 gid, err := strconv.Atoi(group)
62 // if group is not a number,
63 // search for the group path's id and assign it to gid
64 if err != nil {
65 gid, err = getGroupID(group)
66 if err != nil {
67 return fmt.Errorf("couldn't find the id of group %s, got error: %v",
68 group, err)
69 }
70 }
71 _, err = git.Groups.DeleteGroup(gid)
72 if err != nil {
73 return err
74 }
75 fmt.Printf("Group (%s) with id (%d) has been deleted\n", group, gid)
76 return nil
77}

Callers 2

TestNewGroupFunction · 0.85
delete_group.goFile · 0.85

Calls 2

newGitlabClientFunction · 0.85
getGroupIDFunction · 0.85

Tested by 1

TestNewGroupFunction · 0.68