Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
/go-homedirPublic archive

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

License

NotificationsYou must be signed in to change notification settings

mitchellh/go-homedir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Usage is incredibly simple, just callhomedir.Dir() to get the home directoryfor a user, andhomedir.Expand() to expand the~ in a path to the homedirectory.

Why not just useos/user? The built-inos/user package requirescgo on Darwin systems. This means that any Go code that uses that packagecannot cross compile. But 99% of the time the use foros/user is just toretrieve the home directory, which we can do for the current user withoutcgo. This library does that, enabling cross-compilation.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp