15 lines
234 B
Go
15 lines
234 B
Go
|
package application
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"sirlab.de/go/knyt/user"
|
||
|
)
|
||
|
|
||
|
func (app Application) GetUserById(id string) (*user.User, error) {
|
||
|
usr := app.users[id]
|
||
|
if usr == nil {
|
||
|
return nil, fmt.Errorf("unknown id")
|
||
|
}
|
||
|
return usr, nil
|
||
|
}
|