Created
August 4, 2019 16:25
-
-
Save burubur/be675731d54c2bb5cc74e9c753601512 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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