talm

Форк
0
/
ctxutil.go 
17 строк · 534.0 Байт
1
// This Source Code Form is subject to the terms of the Mozilla Public
2
// License, v. 2.0. If a copy of the MPL was not distributed with this
3
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4

5
// Package ctxutil provides utilities for working with contexts.
6
package ctxutil
7

8
import "context"
9

10
// Cause returns the cause of the context error, or nil if there is no error or the error is a usual context error.
11
func Cause(ctx context.Context) error {
12
	if c := context.Cause(ctx); c != ctx.Err() {
13
		return c
14
	}
15

16
	return nil
17
}
18

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.