/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/kbfs/kbfstool/errors.go
31 строка
648 B
zoom-ua
modernize error handling with errors.As/Is (#29350)
25 июн 2026, 17:41
Не верифицирован
25 июн 2026, 17:41
e09e254
Код
Авторство
О чём код?
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package main import ( "errors" "fmt" ) var ( errExactlyOnePath = errors.New("exactly one path must be specified") errAtLeastOnePath = errors.New("at least one path must be specified") ) type cannotWriteErr struct { pathStr string err error } func (e cannotWriteErr) Error() string { if e.err != nil { return fmt.Sprintf("cannot write to %s: %v", e.pathStr, e.err) } return fmt.Sprintf("cannot write to %s", e.pathStr) } func (e cannotWriteErr) Unwrap() error { return e.err }