What is the Go-way to obtain the owner of a file? I spent some time on this yesterday but found no simple solution. On poster suggested fi.Sys().(*syscall.Stat_t).Uid.
Some posts suggested that since there is no operating system independent way to do this Go has left it unimplemented. In particular there would be differences between Windows and GNU/Linux in this area.
I’ll continue to work on this today and reply to my post with the solution (if I can find one) that I wound up using.
Update: I’ve decided to go with fi.Sys().(*syscall.Stat_t).Uid approach. Along the way I was reminded/learned a few things. user.Uid is a string. To get a uint32 from it one must use strconv.ParseUint() and unit32().
I also just learned about go doc. As in:
go doc strconv
Cheers, -Randy