diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2016-01-08 19:35:57 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2016-01-08 20:36:37 +0800 |
commit | e2fdd335415d39083ef9ff5950dd4050f25b193a (patch) | |
tree | 2e8d1e671fc141c2f6907f7567d5bdf57119b61e /whisper/doc.go | |
parent | 32226f1b0cb98286cfd3f2898c344df1dfca45ec (diff) | |
download | go-tangerine-e2fdd335415d39083ef9ff5950dd4050f25b193a.tar go-tangerine-e2fdd335415d39083ef9ff5950dd4050f25b193a.tar.gz go-tangerine-e2fdd335415d39083ef9ff5950dd4050f25b193a.tar.bz2 go-tangerine-e2fdd335415d39083ef9ff5950dd4050f25b193a.tar.lz go-tangerine-e2fdd335415d39083ef9ff5950dd4050f25b193a.tar.xz go-tangerine-e2fdd335415d39083ef9ff5950dd4050f25b193a.tar.zst go-tangerine-e2fdd335415d39083ef9ff5950dd4050f25b193a.zip |
common: Fix HomeDir detection
I am working on porting geth to [Ubuntu Core](https://developer.ubuntu.com/en/snappy/https://developer.ubuntu.com/en/snappy/). I am testing geth on a Raspberry PI and for Ubuntu Core the $HOME directory is unique for each application. See [here](https://developer.ubuntu.com/en/snappy/guides/filesystem-layout) for more information of their filesystem layout.
For some reason in Go `usr.HomeDir` returns a different value than `$HOME` in Ubuntu Core.
Adding this at the end of `HomeDir()`
```go
fmt.Printf("at HomeDir, user.HomeDir = %s and $HOME is %s\n", usr.HomeDir, os.Getenv("HOME"))
```
gives the following output
```
at HomeDir, user.HomeDir = /home/ubuntu and $HOME is /home/ubuntu/apps/geth.sideload/IJcODREBYbHO
```
With this commit, I propose giving precedence to the `$HOME` environment variable as is also suggested by the [homedir](https://github.com/mitchellh/go-homedir/blob/master/homedir.go) project.
Diffstat (limited to 'whisper/doc.go')
0 files changed, 0 insertions, 0 deletions