code: func (api UsersAPI) ListEmailAddresses(w http.ResponseWriter, r *http.Request) {
  	username := mux.Vars(r)["username"]
  	validated := strings.Contains(r.URL.RawQuery, "validated")
  	userMgr := user.NewManager(r)
  	userobj, err := userMgr.GetByName(username)
  	if err != nil {
  		http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
  		return
  	}
  	var emails []user.EmailAddress
  	if validated {
  		emails, err = api.getValidatedEmails(r, *userobj)
  		if handleServerError(w, "getting validated emails", err) {
  			return
  		}
  	} else {
  		emails = userobj.EmailAddresses
  	}
  
  	w.Header().Set("Content-Type", "application/json")
  	json.NewEncoder(w).Encode(emails)
  }
docs: // ListEmailAddresses is the handler for GET /users/{username}/emailaddresses