Skip to content

Instantly share code, notes, and snippets.

@burubur
Created August 4, 2019 16:25
Show Gist options
  • Save burubur/be675731d54c2bb5cc74e9c753601512 to your computer and use it in GitHub Desktop.
Save burubur/be675731d54c2bb5cc74e9c753601512 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
"runtime"
)
var template = `
nama mesin %33v
arsitektur mesin %12v
sitem operasi %16v
jumlah Core CPU %9v
jumlah Go routine aktif %v
versi Go %23v
`
func main() {
hostName, _ := os.Hostname()
textOutput := fmt.Sprintf(template,
hostName,
runtime.GOARCH,
runtime.GOOS,
runtime.NumCPU(),
runtime.NumGoroutine(),
runtime.Version(),
)
fmt.Println(textOutput)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment