Re: [go-nuts] Force pointer at compile time to interface{} parameter

2018-11-19 Thread Chris Burkert
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

[go-nuts] Force pointer at compile time to interface{} parameter

2018-11-19 Thread hay
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() } Above is the correct version, but some