Could not find the go makedonwn, borrow C ha,
1. Strong commonality, the method of
newList:=make ([] interface {}, 0)
2. The specified directly used good slice structure,
newList:=make ([] Liststruct, 0)
I am a novice, don't know the use that is a best practice, if there is a difference between performance? Everyone in the work which is commonly used in defining way?
CodePudding user response:
Can be used in two ways, when you know what it needs in slice data, with the second, traversed can directly use the data, when you don't know what it needs in slice data with the first, traversed to interface {} type conversion, of course, the first one to put different types of data slice,