reflect.Elem() Function in Golang with Examples
Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Elem() Function in Golang is used to get the value that the interface v contains or that the pointer v points to. To access this function, one needs to imports the reflect package in the program.
Syntax:func (v Value) Elem() Value
Parameters: This function does not accept any parameters.
Return Value: This function returns the value that the interface v contains.
Below examples illustrate the use of the above method in Golang:
Id int 0 Title string Price float32 0 Authors string