Trim space from createuser input
This commit is contained in:
parent
3b778226c8
commit
772c54f6fe
4
pkg.go
4
pkg.go
@ -49,6 +49,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const VERSION = "v0.1.0"
|
||||
@ -239,12 +240,15 @@ func (service *Service) CreateUserPrompt() { // {{{
|
||||
|
||||
fmt.Printf("Username: ")
|
||||
username, _ = reader.ReadString('\n')
|
||||
username = strings.TrimSpace(username)
|
||||
|
||||
fmt.Printf("Name: ")
|
||||
name, _ = reader.ReadString('\n')
|
||||
name = strings.TrimSpace(name)
|
||||
|
||||
fmt.Printf("Password: ")
|
||||
password, _ = reader.ReadString('\n')
|
||||
password = strings.TrimSpace(password)
|
||||
|
||||
err = service.CreateUser(username, password, name)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user