all: update to Go 1.20, use strings.CutPrefix/Suffix instead of our fork
Updates #7123 Updates #5309 Change-Id: I90bcd87a2fb85a91834a0dd4be6e03db08438672 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
623176ebc9
commit
b1248442c3
@@ -41,7 +41,6 @@ import (
|
||||
"tailscale.com/tempfork/gliderlabs/ssh"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/lineread"
|
||||
"tailscale.com/util/strs"
|
||||
"tailscale.com/version/distro"
|
||||
)
|
||||
|
||||
@@ -653,7 +652,7 @@ func pathFromPAMEnvLine(line []byte, u *user.User) (path string) {
|
||||
return ""
|
||||
}
|
||||
rest := strings.TrimSpace(strings.TrimPrefix(string(line), "PATH"))
|
||||
if quoted, ok := strs.CutPrefix(rest, "DEFAULT="); ok {
|
||||
if quoted, ok := strings.CutPrefix(rest, "DEFAULT="); ok {
|
||||
if path, err := strconv.Unquote(quoted); err == nil {
|
||||
return expandDefaultPathTmpl(path, u)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user