platform

package
v0.10.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsWSL

func IsWSL() bool

IsWSL returns true if running in any WSL environment

func IsWSL1

func IsWSL1() bool

IsWSL1 returns true if running specifically in WSL1

func IsWSL2

func IsWSL2() bool

IsWSL2 returns true if running specifically in WSL2

func SupportsUnixSockets

func SupportsUnixSockets() bool

SupportsUnixSockets returns true if the platform reliably supports Unix domain sockets

Types

type Platform

type Platform string

Platform represents the detected platform

const (
	PlatformMacOS   Platform = "macos"
	PlatformLinux   Platform = "linux"
	PlatformWSL1    Platform = "wsl1"
	PlatformWSL2    Platform = "wsl2"
	PlatformWindows Platform = "windows"
	PlatformUnknown Platform = "unknown"
)

func Detect

func Detect() Platform

Detect returns the current platform, caching the result

func (Platform) String

func (p Platform) String() string

String returns a human-readable platform name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL