Created
October 13, 2021 09:50
-
-
Save filinvadim/dde5a207bbe36a8a629fa56ed2aa947d to your computer and use it in GitHub Desktop.
Get struct method name using reflect
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
val := reflect.ValueOf(&struct{}) | |
for i := 0; i < val.NumMethod(); i++ { | |
name := val.Type().Method(i).Name | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment