Skip to content

e-zk/wslcheck

Repository files navigation

wslcheck GoDoc

Go module to check whether your program is running on Windows Subsystem for Linux.

This module works by checking the contents of /proc/sys/kernel/osrelease.

Usage

$ go get go.zakaria.org/wslcheck
package main

import (
	"fmt"
	"github.com/e-zk/wslcheck"
)

func main() {
	fmt.Printf("Am I running on WSL?\n")

	wsl, _ := wslcheck.Check()
	if wsl == true {
		fmt.Printf("Yes!\n")
	} else {
		fmt.Printf("No!\n")
	}
}

About

Go module to test if program is running on Windows Subsystem for Linux

Resources

License

Stars

Watchers

Forks

Languages