Skip to content

Instantly share code, notes, and snippets.

@filinvadim
Created October 13, 2021 09:50
Show Gist options
  • Save filinvadim/dde5a207bbe36a8a629fa56ed2aa947d to your computer and use it in GitHub Desktop.
Save filinvadim/dde5a207bbe36a8a629fa56ed2aa947d to your computer and use it in GitHub Desktop.
Get struct method name using reflect
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