(cmd *cobra.Command, user string)
| 51 | } |
| 52 | |
| 53 | func 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 | |
| 72 | func descUser(uid int) (*gitlab.User, error) { |
| 73 | git, err := newGitlabClient() |
no test coverage detected