go-homedir

Go library for detecting and expanding the user's home directory without cgo.

Github星跟踪图

go-homedir

This is a Go library for detecting the user's home directory without
the use of cgo, so the library can be used in cross-compilation environments.

Usage is incredibly simple, just call homedir.Dir() to get the home directory
for a user, and homedir.Expand() to expand the ~ in a path to the home
directory.

Why not just use os/user? The built-in os/user package requires
cgo on Darwin systems. This means that any Go code that uses that package
cannot cross compile. But 99% of the time the use for os/user is just to
retrieve the home directory, which we can do for the current user without
cgo. This library does that, enabling cross-compilation.

主要指标

概览
名称与所有者mitchellh/go-homedir
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2014-08-19 18:44:22
推送于2024-03-21 10:31:41
最后一次提交
发布数2
最新版本名称v1.1.0 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数1.4k
关注者数16
派生数125
提交数33
已启用问题?
问题数11
打开的问题数4
拉请求数10
打开的拉请求数2
关闭的拉请求数11
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?