Compare commits

...
Author SHA1 Message Date
phoenix 413d9baffd Fix
Go Release / build-and-release (pull_request) Successful in 5s
Go CI / Test and Lint (pull_request) Failing after 6s
Go CI / Test and Lint (push) Failing after 17s
2026-05-27 22:49:40 -04:00
phoenix 87a437311b Test fix 2026-05-27 22:49:30 -04:00
phoenix 2820cdfed6 Fixed error
Go Release / build-and-release (pull_request) Successful in 6s
Go CI / Test and Lint (push) Failing after 16s
Go CI / Test and Lint (pull_request) Failing after 6s
2026-05-27 22:47:21 -04:00
2 changed files with 3 additions and 12 deletions
+3 -10
View File
@@ -14,18 +14,15 @@ type UserProfile struct {
Username string `json:"username"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Created time `json:"created"`
LastLogin *time `json:"last_login,omitempty"`
Created time.Time `json:"created"`
LastLogin *time.Time `json:"last_login,omitempty"`
}
func InitUserProfile(usr *User) (usrProfile *UserProfile, err error) {
if usr == nil {
return nil, fmt.Errorf("User is empty")
} else {
usrProfile = new(UserProfile)
if len(usr.Password) > 0 {
// newUsr := User{Id: usr.Id, PhoneNumber: usr.PhoneNumber, Username: usr.Username, Firstname: usr.Firstname, Lastname: usr.Lastname, Created: usr.Created, LastLogin: usr.LastLogin}
// usrProfile.Usr = &newUsr
// usrProfile = new(UserProfile)
usrProfile.UserId = usr.Id
usrProfile.PhoneNumber = usr.PhoneNumber
usrProfile.Username = usr.Username
@@ -37,9 +34,5 @@ func InitUserProfile(usr *User) (usrProfile *UserProfile, err error) {
}
return usrProfile, nil
} else {
usrProfile.Usr = usr
return usrProfile, nil
}
}
}
-2
View File
@@ -13,6 +13,4 @@ func TestInitUserProfile(t *testing.T) {
assert.NoError(t, err, "Error %v", err)
assert.NotEmpty(t, profile, "UserProfile is empty")
assert.Empty(t, profile.Usr.Password, "Password should be empty")
}