I have started programming in Go and I was wondering when new(Object)
is used it allocates memory to the size of that object right? If this is the case how do I free this memory once I have finished using the object?
I ask this because in C++ when new
is used on an object you can delete
the object once there is no longer any need for the object to be stored.
I have been searching to see if Go does have delete
or something similar to C++ but I have been unable to find anything.
Any help is much appreciated.