Skip to content

Commit

Permalink
Fixed typo in constructor README.md section (#288)
Browse files Browse the repository at this point in the history
Signed-off-by: George Opritescu <ssscripting@gmail.com>
  • Loading branch information
International authored and roobre committed Aug 3, 2018
1 parent c1d6c20 commit a97563e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ If you implement this constructor:

```go
func newUser(username, password string, emails ...string) (*User, error) {
if username != "" || len(emails) == 0 || password != "" {
return errors.New("all fields are required")
if username == "" || len(emails) == 0 || password == "" {
return nil, errors.New("all fields are required")
}

return &User{Username: username, Password: password, Emails: emails}
return &User{Username: username, Password: password, Emails: emails}, nil
}
```

Expand Down

0 comments on commit a97563e

Please sign in to comment.