gitlab.com/evatix-go/core@v1.3.55/coredata/coredynamic/Readme.md (about) 1 # Readme 2 3 ## Questions and Answers 4 5 ### Diff between Elem and Indirect? 6 7 - https://prnt.sc/26dauyc 8 - 9 10 If a reflect.Value is a pointer, then v.Elem() is equivalent to reflect.Indirect(v). If it is not a pointer, then they 11 are not equivalent: 12 13 If the value is an interface then reflect.Indirect(v) will return the same value, while v.Elem() will return the 14 contained dynamic value. If the value is something else, then v.Elem() will panic. The reflect.Indirect helper is 15 intended for cases where you want to accept either a particular type, or a pointer to that type. One example is the 16 database/sql conversion routines: by using reflect.Indirect, it can use the same code paths to handle the various types 17 and pointers to those types. 18 19 ## Links 20 21 * [go - golang - Elem Vs Indirect in the reflect package - Stack Overflow](https://stackoverflow.com/questions/24318389/golang-elem-vs-indirect-in-the-reflect-package#:~:text=Elem%20returns%20the%20value%20that,Value%20if%20v%20is%20nil.&text=Indirect%20returns%20the%20value%20that%20v%20points%20to.) 22 * [reflect.Indirect() Function in Golang with Examples - GeeksforGeeks](https://www.geeksforgeeks.org/reflect-indirect-function-in-golang-with-examples/)