Golang os.Chown() and Getgid() functions example

package os

Golang os.Chown() and Getgid() functions usage example

 gid := os.Getgid()
 os.Chown(fileInfo.Name(), -1, gid)

References :

http://golang.org/pkg/os/#Getgid

http://golang.org/pkg/os/#Chown

Advertisement