Hello Hay,
with interface{} you explicitly allow everything. Instead you may consider
to restrict the accepted input in the first place - e.g. with a non-empty
interface.
Chris
hay schrieb am Mo. 19. Nov. 2018 um 15:37:
> Hi,
>
> I've the following example code of correct version.
>
> func SomeF
Hi,
I've the following example code of correct version.
func SomeFunction(itemPtr interface{}) {
//itemPtr must be pointer to struct and not struct.
}
func SomeFunctionCaller() {
u := UserRecord{}
SomeFunction(&u)
}
Above is the correct version, but some cod