Yash-Handa / logo-ls

Modern ls command with vscode like File Icon and Git Integrations. Written in Golang
MIT License
1.13k stars 46 forks source link

UID lookup is bad #5

Open james-antill opened 3 years ago

james-antill commented 3 years ago

If you can't find a user you should use the UID not the empty string. Here:

https://github.com/Yash-Handa/logo-ls/blob/f6f6bee4156bf08340cce5246963e6eb26d1ce3d/formatterStuff.go#L88

...then two lines later you should print u.Username not u.Name:

https://github.com/Yash-Handa/logo-ls/blob/f6f6bee4156bf08340cce5246963e6eb26d1ce3d/formatterStuff.go#L90

...the first problem is repeated for group lookup error path.

james-antill commented 3 years ago

You could also save a bit of space/time by creating the map as map[uint64]string and then testing before you have to do strconv.Itoa().