Skip to content

Commit 36dcef5

Browse files
committed
prevent bad errors on osx
1 parent 1213508 commit 36dcef5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"os"
1111
"os/user"
1212
"path/filepath"
13+
"runtime"
1314
"runtime/debug"
1415
"strconv"
1516
"strings"
@@ -97,6 +98,9 @@ func launchSelfLater() {
9798
}
9899

99100
func main() {
101+
// prevents bad errors in OSX, such as [NS...] is only safe to invoke on the main thread.
102+
runtime.LockOSThread()
103+
100104
// Parse regular flags
101105
flag.Parse()
102106

0 commit comments

Comments
 (0)