/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/git/errors.go
23 строки
630 B
zoom-ua
remove golang.org/x/net/context in favor of context (#28708)
17 дек 2025, 18:24
Не верифицирован
17 дек 2025, 18:24
67b0ffe
Код
Авторство
О чём код?
package git import ( "context" "fmt" "github.com/keybase/client/go/libkb" ) // For errors that expect, replace them with nice strings for the user. The GUI // will show these directly. func HumanizeGitErrors(ctx context.Context, g *libkb.GlobalContext, err error) error { switch e := err.(type) { case libkb.RepoAlreadyExistsError: g.Log.CDebugf(ctx, "replacing error: %v", err) return fmt.Errorf("A repo named %q already exists.", e.ExistingName) case libkb.InvalidRepoNameError: g.Log.CDebugf(ctx, "replacing error: %v", err) return fmt.Errorf("%q isn't a valid repo name.", e.Name) default: return err } }