(ctx context.Context, rep repo.Repository)
| 22 | } |
| 23 | |
| 24 | func (c *commandServerUserList) runUserList(ctx context.Context, rep repo.Repository) error { |
| 25 | var jl jsonList |
| 26 | |
| 27 | jl.begin(&c.jo) |
| 28 | defer jl.end() |
| 29 | |
| 30 | profiles, err := user.ListUserProfiles(ctx, rep) |
| 31 | if err != nil { |
| 32 | return errors.Wrap(err, "error listing user profiles") |
| 33 | } |
| 34 | |
| 35 | for _, p := range profiles { |
| 36 | if c.jo.jsonOutput { |
| 37 | jl.emit(p) |
| 38 | } else { |
| 39 | c.out.printStdout("%v\n", p.Username) |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | return nil |
| 44 | } |
nothing calls this directly
no test coverage detected