aboutsummaryrefslogtreecommitdiffstats
path: root/entities/identity/identity_user.go
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-12-23 07:16:36 -0500
committerGitHub <noreply@github.com>2022-12-23 07:16:36 -0500
commitf94616ec76e01145a7b2b90c11b27a25d4a4be96 (patch)
tree885844b5412f824b4ba9aad3725080dded0d27fe /entities/identity/identity_user.go
parent0a5a0ec1ef4ad98bc2116a953e201f96474941ab (diff)
parent0cd2f3b4bda294b040e31337ddb380fb72192a63 (diff)
downloadgit-bug-f94616ec76e01145a7b2b90c11b27a25d4a4be96.tar.gz
Merge pull request #936 from MichaelMure/feat/935/disambiguate-config-errors
feat(935): disambiguate config errors
Diffstat (limited to 'entities/identity/identity_user.go')
-rw-r--r--entities/identity/identity_user.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/entities/identity/identity_user.go b/entities/identity/identity_user.go
index e671e662..7eb374d4 100644
--- a/entities/identity/identity_user.go
+++ b/entities/identity/identity_user.go
@@ -36,10 +36,10 @@ func GetUserIdentity(repo repository.Repo) (*Identity, error) {
func GetUserIdentityId(repo repository.Repo) (entity.Id, error) {
val, err := repo.LocalConfig().ReadString(identityConfigKey)
- if err == repository.ErrNoConfigEntry {
+ if errors.Is(err, repository.ErrNoConfigEntry) {
return entity.UnsetId, ErrNoIdentitySet
}
- if err == repository.ErrMultipleConfigEntry {
+ if errors.Is(err, repository.ErrMultipleConfigEntry) {
return entity.UnsetId, ErrMultipleIdentitiesSet
}
if err != nil {
@@ -58,7 +58,7 @@ func GetUserIdentityId(repo repository.Repo) (entity.Id, error) {
// IsUserIdentitySet say if the user has set his identity
func IsUserIdentitySet(repo repository.Repo) (bool, error) {
_, err := repo.LocalConfig().ReadString(identityConfigKey)
- if err == repository.ErrNoConfigEntry {
+ if errors.Is(err, repository.ErrNoConfigEntry) {
return false, nil
}
if err != nil {