Skip to content

wakatime/goInfo

This branch is 1 commit behind matishsiao/goInfo:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4684988 · Dec 4, 2024

History

34 Commits
Jun 9, 2014
Oct 3, 2017
Dec 8, 2021
Feb 4, 2022
Apr 24, 2021
Oct 3, 2017
Feb 4, 2022
Feb 4, 2022
Feb 4, 2022
Feb 4, 2022
Feb 4, 2022
Dec 4, 2024

Repository files navigation

Introduction:

GoInfo is get os platform information coding by Golang.

It can help you to know os information.

Version:

version:0.0.1

Futures

get linux information

get windows information

get osx information

get freebsd information

Install:

  go get github.com/matishsiao/goInfo
  go build

Struct:

  type GoInfoObject struct {
	GoOS string
	Kernel string
	Core string
	Platform string
	OS string
	Hostname string
	CPUs int
}

Example:

   package main

   import (
	   "github.com/matishsiao/goInfo"
   )

   func main() {
		gi, _ := goInfo.GetInfo()
		gi.VarDump()
	 }
}

It's will show:

   GoOS: linux
   Kernel: Linux
   Core: 3.13.0-27-generic
   Platform: x86_64
   OS: GNU/Linux
   Hostname: ubuntu
   CPUs: 1

##License and Copyright This software is Copyright 2012-2014 Matis Hsiao.

About

get os information use golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%