mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
fix: appease linter on darwin (#11154)
Fixing up some linting errors that show up on Darwin, but not in CI.
This commit is contained in:
@@ -13,6 +13,10 @@ import (
|
||||
func Get(username string) (string, error) {
|
||||
// This command will output "UserShell: /bin/zsh" if successful, we
|
||||
// can ignore the error since we have fallback behavior.
|
||||
if !filepath.IsLocal(username) {
|
||||
return "", xerrors.Errorf("username is nonlocal path: %s", username)
|
||||
}
|
||||
//nolint: gosec // input checked above
|
||||
out, _ := exec.Command("dscl", ".", "-read", filepath.Join("/Users", username), "UserShell").Output()
|
||||
s, ok := strings.CutPrefix(string(out), "UserShell: ")
|
||||
if ok {
|
||||
|
||||
Reference in New Issue
Block a user