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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?