ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
_, err := m.DB.Exec(ctx, stmt, email, username, password)
If the containing function gets cancelled by the context defer cancel() , what get return to the caller?
defer func(ctx context.CancelFunc) error {
err := errors.New("timeout")
ctx()
}(cancel
or is this my only option?