I want to set the uid and gid on files that are created by our golang application. It looks like the right place is use the os.FileMode. I am looking for an example of setting the permissions and uid and gid all in one step.
Setting the permissions looks pretty straightforward:
os.FileMode(hdr.Mode&0777)
But I am not sure how to also set the uid/gid on FileMode.
Not sure what do you mean by one step, I use following method to set uid & gid
func Chown(path string, uid int, gid int)