players/users.go
func NewUser(player uuid.UUID, userdata *User) (*User, error) {
	p, err := storage.Load(player)
	if err != nil {
		return nil, err
	}
	p.User = *userdata
	//fmt.Println("Creating user:")
	//fmt.Printf("%v", p.User)
	err = storage.Store(p)
	if err != nil {
		return nil,
			errors.New(err.Error() + " - Could not write user to storage")
	}
	return &p.User, nil
}
func NewUser(player uuid.UUID, userdata *User) (*User, error) {
	p, err := storage.Load(player)
	if err != nil {
		return nil, err
	}
	p.User = *userdata
	//fmt.Println("Creating user:")
	//fmt.Printf("%v", p.User)
	err = storage.Store(p)
	if err != nil {
		return nil,
			errors.New(err.Error() + " - Could not write user to storage")
	}
	return &p.User, nil
}
func NewUser ( player uuid . UUID , userdata * User ) ( * User , error ) { p , err := storage . Load ( player ) if err != nil { return nil , err } p . User = * userdata //fmt.Println("Creating user:") //fmt.Printf("%v", p.User) err = storage . Store ( p ) if err != nil { return nil , errors . New ( err . Error ( ) + " " ) } return & p . User , nil }
// Create a user
Create a user