I do know there are tons of assets however coming from C# background, studying about all these simply makes me extra confused. For basic objective, which one is preferable and what are the professionals/cons of every method.
Slice of struct pointers being handed as parameter or returned from a operate:
func getAllAnimals() []*Animal {
}
func printAllAnimals(animals []*Animal) {
}
V/S
Slice of struct being handed as parameter or returned from a operate:
func getAllAnimals() []Animal {
}
func printAllAnimals(animals []Animal) {
}
it’s best to write like this in golang
func getAllAnimals() (Animal,error) {
var(
x Animal
err error
)
return x,nil
}
information,err := getAllAnimals()
if err != nil {
}
sort or paste code right here