Created
August 9, 2019 18:18
-
-
Save blanchonvincent/e81cc6a6a389ed1bbffba114683f4ab9 to your computer and use it in GitHub Desktop.
Medium - Empty interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func emptyInterface(i interface {}) { | |
s := i.(*MultipleFieldStructure) | |
y = s | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Vincent
I was going through your medium article and you said
a good solution would be to use the pointer and convert back to this same struct pointer
.How do we achieve this?
what should be the declaration type of
y
likewise in the case ofvar x MultipleFieldStructure
Can you please provide a complete example of this? I'm quite new and trying to get my head around.