Commit 3d15577
committed
Replace go-homedir with stdlib calls
The purpose of github.com/mitchellh/go-homedir was to expand the user
home directory without CGO. Recent versions of `os/user` can retrieve
the user home directory without CGO and thus enable cross-compilation.
This change does not add the missing functionality of expanding
non-current-user home directories in a path (e.g. `~user2/dir/subdir`).
The reason for this is that the input of `pathOrContents` could be a
blob and parsing every byte slice matching `^~.*\/.*` as a path
considerably increases the chances that a binary blob is mistakenly
parsed as a path.1 parent f67ecca commit 3d15577
3 files changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | | - | |
12 | | - | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
0 commit comments