go/access: detect WSL differently

This commit is contained in:
Luke Granger-Brown 2022-05-17 01:36:33 +01:00
parent 7f587564de
commit a4c6ad17dc

View file

@ -42,12 +42,8 @@ func currentUsername() string {
}
func shouldRequirePresence() bool {
hn, err := os.Hostname()
if err != nil {
log.Fatalf("getting hostname: %v", err)
}
// WSL2 makes things hard.
return hn != "PORCOROSSO"
return os.Getenv("WSL_DISTRO_NAME") == ""
}
const (