func (s SystemHook) NewUserID() (int64, error) { users, err := webhooks.ListUsers(conf) if err != nil { return -1, err } for _, user := range users { if user.Email == s.Email { return user.ID, nil } } return -1, errors.New(fmt.Sprintf("User: %s not found", s.Email)) }
func HandleListUsers() { users, err := webhooks.ListUsers(conf) if err != nil { fmt.Println(err) return } for _, user := range users { fmt.Println(fmt.Sprintf( `ID: %d Email: %s Name: %s Username: %s -------------------`, user.ID, user.Email, user.Name, user.Username, )) } }