(ctx context.Context)
| 66 | } |
| 67 | |
| 68 | func genFarewell(ctx context.Context) (string, error) { |
| 69 | switch locale, err := locale(ctx); { |
| 70 | case err != nil: |
| 71 | return "", err |
| 72 | case locale == "EN/US": |
| 73 | return "goodbye", nil |
| 74 | } |
| 75 | return "", fmt.Errorf("unsupported locale") |
| 76 | } |
| 77 | |
| 78 | func locale(ctx context.Context) (string, error) { |
| 79 | if deadline, ok := ctx.Deadline(); ok { |
no test coverage detected