Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0ec54eb9f
|
||
|
|
b615219c5b
|
@@ -18,14 +18,14 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.26.2'
|
go-version: '1.26.1'
|
||||||
|
|
||||||
- name: Create version
|
- name: Create version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
echo "Creating version"
|
echo "Creating version"
|
||||||
|
|
||||||
VERSION="0.2.1"
|
VERSION="0.2.0"
|
||||||
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
|
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
|
||||||
BRANCH_REF="${{ gitea.ref }}"
|
BRANCH_REF="${{ gitea.ref }}"
|
||||||
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
|
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
package user
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
type UserProfile struct {
|
|
||||||
Usr *User `json:"user"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func InitUserProfile(usr *User) (usrProfile *UserProfile, done bool) {
|
|
||||||
if usr == nil {
|
|
||||||
return nil, false
|
|
||||||
} else {
|
|
||||||
if len(usr.Password) > 0 {
|
|
||||||
var newUsr User
|
|
||||||
newUsr = *usr
|
|
||||||
newUsr.Password = ""
|
|
||||||
usrProfile.Usr = &newUsr
|
|
||||||
|
|
||||||
return usrProfile, true
|
|
||||||
} else {
|
|
||||||
usrProfile.Usr = usr
|
|
||||||
return usrProfile, true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestInitUserProfile(t *testing.T) {
|
|
||||||
usr := User{}
|
|
||||||
usr.Username = "Bob"
|
|
||||||
usr.PhoneNumber = "+12224572351"
|
|
||||||
usr.Password = "TheNight!"
|
|
||||||
profile, done := InitUserProfile(&usr)
|
|
||||||
assert.Equal(t, done, true, "Error")
|
|
||||||
assert.NotEmpty(t, profile, "UserProfile is empty")
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user