vendor: Update everything

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4620
This commit is contained in:
Jakob Borg
2017-12-29 11:38:00 +00:00
parent 1296a22069
commit c24bf7ea55
1070 changed files with 294926 additions and 488191 deletions

View File

@@ -397,7 +397,7 @@ func (d *GoDict) S(id int) (s string, ok bool) {
// to a string slice over an unreferenced biger underlying string keeps the biger one
// in memory anyway - it can't be GCed.
func StrPack(s string) string {
return string([]byte(s))
return string([]byte(s)) // T(U(T)) intentional.
}
// JoinFields returns strings in flds joined by sep. Flds may contain arbitrary
@@ -665,6 +665,19 @@ func Gopath() string {
}
}
// Homepath returns the user's home directory path.
func Homepath() string {
// go1.8: https://github.com/golang/go/blob/74628a8b9f102bddd5078ee426efe0fd57033115/doc/code.html#L122
switch runtime.GOOS {
case "plan9":
return os.Getenv("home")
case "windows":
return os.Getenv("USERPROFILE")
default:
return os.Getenv("HOME")
}
}
// ImportPath returns the import path of the caller or an error, if any.
func ImportPath() (string, error) {
_, file, _, ok := runtime.Caller(1)