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

Function runDescUser

cmd/desc_user.go:53–70  ·  view source on GitHub ↗
(cmd *cobra.Command, user string)

Source from the content-addressed store, hash-verified

51}
52
53func runDescUser(cmd *cobra.Command, user string) error {
54 uid, err := strconv.Atoi(user)
55 // if user is not a number,
56 // search for the username's user id and assign it to uid
57 if err != nil {
58 foundUser, err2 := getUserByUsername(user)
59 if err2 != nil {
60 return err2
61 }
62 uid = foundUser.ID
63 }
64 userInfo, err := descUser(uid)
65 if err != nil {
66 return err
67 }
68 printUsersOut(getFlagString(cmd, "out"), userInfo)
69 return nil
70}
71
72func descUser(uid int) (*gitlab.User, error) {
73 git, err := newGitlabClient()

Callers 1

desc_user.goFile · 0.85

Calls 4

getUserByUsernameFunction · 0.85
descUserFunction · 0.85
printUsersOutFunction · 0.85
getFlagStringFunction · 0.85

Tested by

no test coverage detected