Skip to content

Commit

Permalink
Avoid to use uname syscall for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Aug 10, 2023
1 parent e477796 commit 53b4432
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cmd/enable_wsl_systemd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
"log"
"os"
"strings"
"syscall"

"golang.org/x/sys/unix"
)

// Exists for remember https://github.com/kachick/dotfiles/pull/264#discussion_r1289600371
Expand All @@ -15,8 +16,8 @@ import (
func main() {
// wsl.exe returns non English even in called on the VM https://github.com/microsoft/WSL/issues/9242
// And always having non ASCII, annoy to depend with the output :<
uname := syscall.Utsname{}
err := syscall.Uname(&uname)
uname := unix.Utsname{}
err := unix.Uname(&uname)
if err != nil {
log.Fatalf("cannot get uname: %+v\n", err)
}
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ module github.com/kachick/dotfiles

go 1.20

require golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b
require (
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b
golang.org/x/sys v0.11.0
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b h1:r+vk0EmXNmekl0S0BascoeeoHk/L7wmaW2QF90K+kYI=
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

0 comments on commit 53b4432

Please sign in to comment.