aboutsummaryrefslogtreecommitdiff
path: root/go-src/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'go-src/user.go')
-rw-r--r--go-src/user.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/go-src/user.go b/go-src/user.go
index 78501c7..9b49fd1 100644
--- a/go-src/user.go
+++ b/go-src/user.go
@@ -17,8 +17,8 @@ type User struct {
type UserProp int
const (
- passwordProp UserProp = iota + 1
- nameProp
+ userPasswordProp UserProp = iota + 1
+ userNameProp
)
func (u User) ValidatePassword(password string) bool {
@@ -35,9 +35,9 @@ func (u User) updateProp(currentPassword string, newValue string, userProp UserP
var fileContents []byte
switch userProp {
- case passwordProp:
+ case userPasswordProp:
fileContents = []byte(u.Username + "\n" + newValue + "\n" + u.Name)
- case nameProp:
+ case userNameProp:
fileContents = []byte(u.Username + "\n" + currentPassword + "\n" + newValue)
default:
return false
@@ -51,11 +51,11 @@ func (u User) updateProp(currentPassword string, newValue string, userProp UserP
}
func (u User) UpdatePassword(oldPassword string, newPassword string) bool {
- return u.updateProp(oldPassword, newPassword, passwordProp)
+ return u.updateProp(oldPassword, newPassword, userPasswordProp)
}
func (u User) UpdateName(password string, newName string) bool {
- return u.updateProp(password, newName, nameProp)
+ return u.updateProp(password, newName, userNameProp)
}
func logoutUser() {