forked from External/grumble
Major gofix run.
This commit is contained in:
parent
92e6ac5276
commit
71b8314c2e
28 changed files with 522 additions and 559 deletions
8
user.go
8
user.go
|
|
@ -6,7 +6,7 @@ package main
|
|||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"os"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// This file implements Server's handling of Users.
|
||||
|
|
@ -26,12 +26,12 @@ type User struct {
|
|||
}
|
||||
|
||||
// Create a new User
|
||||
func NewUser(id uint32, name string) (user *User, err os.Error) {
|
||||
func NewUser(id uint32, name string) (user *User, err error) {
|
||||
if id < 0 {
|
||||
return nil, os.NewError("Invalid user id")
|
||||
return nil, errors.New("Invalid user id")
|
||||
}
|
||||
if len(name) == 0 {
|
||||
return nil, os.NewError("Invalid username")
|
||||
return nil, errors.New("Invalid username")
|
||||
}
|
||||
|
||||
return &User{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue