From f8f49868f4efe2e547842b6d1d360308725c9071 Mon Sep 17 00:00:00 2001 From: Georges Varouchas Date: Thu, 23 Sep 2021 11:00:00 +0200 Subject: [PATCH] fix cache condition in iswin_wasm unless I am mistaken, the boolean dance here does not match the intentions : in its current version, `checkedIfWindows` is never set to true to each individual call to `CheckIfWindows()` will trigger a call to `os.Stat()` --- internal/fs/iswin_wasm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fs/iswin_wasm.go b/internal/fs/iswin_wasm.go index f135ca4d0b..b44a60e06d 100644 --- a/internal/fs/iswin_wasm.go +++ b/internal/fs/iswin_wasm.go @@ -12,7 +12,7 @@ var cachedIfWindows bool func CheckIfWindows() bool { if !checkedIfWindows { - cachedIfWindows = false + checkedIfWindows = true // Hack: Assume that we're on Windows if we're running WebAssembly and // the "C:\\" directory exists. This is a workaround for a bug in Go's