knowyt/server/src/application/getUser.go

15 lines
234 B
Go
Raw Normal View History

2021-08-04 22:12:28 +00:00
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
}