Last active
May 28, 2021 05:57
-
-
Save woodgear/d509e63becab7115f036cd47d64128db to your computer and use it in GitHub Desktop.
go-home-dir #go #path #homedir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"fmt" | |
"log" | |
) | |
func main() { | |
dirname, err := os.UserHomeDir() | |
if err != nil { | |
log.Fatal( err ) | |
} | |
fmt.Println( dirname ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment