Last active
November 8, 2022 20:13
-
-
Save BetterProgramming/e5a69b68775f8840ca2c49b7fd7ec5c5 to your computer and use it in GitHub Desktop.
This file contains 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
func TestMemStats(t *testing.T) { | |
var m runtime.MemStats | |
runtime.ReadMemStats(&m) | |
v := reflect.ValueOf(&m).Elem() | |
for i := 0; i < v.NumField(); i++ { | |
t.Logf("%s %s %v \n", | |
v.Field(i).Type(), | |
v.Type().Field(i).Name, | |
v.Field(i).Interface()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment