27 lines
338 B
Go
27 lines
338 B
Go
package app
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
func RunApp(ctx context.Context) error {
|
|
u := &User{
|
|
Name: "hola",
|
|
}
|
|
if !UserOK(ctx, u) {
|
|
return fmt.Errorf("could not found user")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type User struct {
|
|
Name string
|
|
}
|
|
|
|
func UserOK(ctx context.Context, user *User) bool {
|
|
if user == nil {
|
|
return false
|
|
}
|
|
return true
|
|
}
|