Files
commander/examples/basic/service.go
2024-08-01 23:42:30 +03:00

26 lines
399 B
Go

package main
import (
"context"
"fmt"
"git.derfenix.pro/fenix/commander"
"github.com/google/uuid"
)
func main() {
ctx := context.Background()
cmd := commander.New(10)
c1 := GetName{UID: uuid.NewString()}
c2 := GetAddress{Input: &c1.Result}
commands := []commander.Command{&c1, &c2}
if err := cmd.Execute(ctx, "", commands...); err != nil {
panic(err)
}
fmt.Println(c2.Result)
}