Skip to content

Commit

Permalink
Issue #171: Fix username returning domain name in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
F1bonacc1 committed Apr 6, 2024
1 parent 5a554d3 commit 95fc418
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ func getUser() string {
log.Warn().Err(err).Msg("Failed to retrieve user info.")
return ""
}
return usr.Username
username := usr.Username
if strings.Contains(username, "\\") {
parts := strings.Split(username, "\\")
username = parts[len(parts)-1]
}
return username
}

func mode() string {
Expand Down

0 comments on commit 95fc418

Please sign in to comment.