--- a/youtrack/user.go Thu Jan 16 00:02:27 2020 -0600
+++ b/youtrack/user.go Thu Jan 16 01:16:43 2020 -0600
@@ -5,6 +5,7 @@
@@ -70,30 +71,48 @@
func (c *Client) ImportUsers(p *Project) error {
// loop through the users we were given and create a new list based on the
// ones that we need to create.
for _, user := range p.Users {
+ fmt.Printf("checking if user %q exists ... ", user.Login) exists, err := c.UserExists(user.Login)
+ fmt.Printf("failed.\n") + fmt.Printf("no, will be created.\n") users = append(users, user)
+ fmt.Printf("all users exist, nothing to import.\n") for s := 0; s < len(users); s += r {
- fmt.Printf("importing users %d-%d ...", s, e)
+ sUsers := make([]string, e-s) + for idx, user := range users[s:e] { + sUsers[idx] = user.Login + fmt.Printf("importing users %s ... ", strings.Join(sUsers, ", ")) if errs := c.importUsersRange(users, s, e); len(errs) > 0 {