From a0045c79caeca54b0794934271d9b0a0ff9a9194 Mon Sep 17 00:00:00 2001 From: Faraz Fallahi Date: Fri, 28 Oct 2022 00:55:46 -0400 Subject: [PATCH] Update sysinfo.go --- sysinfo.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sysinfo.go b/sysinfo.go index 30b851d..f56ebb9 100644 --- a/sysinfo.go +++ b/sysinfo.go @@ -5,6 +5,8 @@ // Package sysinfo is a Go library providing Linux OS / kernel / hardware system information. package sysinfo +import "runtime" + // SysInfo struct encapsulates all other information structs. type SysInfo struct { Meta Meta `json:"sysinfo"` @@ -23,6 +25,10 @@ type SysInfo struct { // GetSysInfo gathers all available system information. func (si *SysInfo) GetSysInfo() { + if runtime.GOOS != "linux" { + return + } + // Meta info si.getMetaInfo()