Possibly related: Convert interface{} to map in Golang推荐答案 reflect 模块显示Sys()返回的数据类型为*syscall.Stat_t,因此这似乎可以将文件的Gid作为字符串获取:The reflect module showed that the data type for Sys()'s return is *syscall.Stat_t, so this seems to work to get the Gid of a file as a string:file_info, _ := os.Stat(abspath)file_sys := file_info.Sys()file_gid := fmt.Sprint(file_sys.(*syscall.Stat_t).Gid)如果有更好的方法,请告诉我.Please let me know if there is a better way to do this. 这篇关于如何在Go中获取文件的组ID(GID)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-30 17:52