commit
491131321a
6 changed files with 136 additions and 0 deletions
27
pkg/app/app.go
Normal file
27
pkg/app/app.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue