MCPcopy
hub / github.com/luk4z7/go-concurrency-guide / printFarewell

Function printFarewell

patterns/contextpackage/cancel/main.go:45–53  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

43}
44
45func printFarewell(ctx context.Context) error {
46 farewell, err := genFarewell(ctx)
47 if err != nil {
48 return err
49 }
50 fmt.Printf("%s world!\n", farewell)
51 return nil
52
53}
54
55func genGreeting(ctx context.Context) (string, error) {
56 ctx, cancel := context.WithTimeout(ctx, 1*time.Second)

Callers 1

mainFunction · 0.85

Calls 1

genFarewellFunction · 0.85

Tested by

no test coverage detected