n Go, the new function allocates memory and initializes it to all zeros. This means that the memory returned by new is guaranteed to be in a safe state, even if the caller does not initialize it further.For example, if you create a new int with new, the memory returned will be all zeros. This means that you can safely assign a value to the int without worrying about overwriting any existing data.The make function also allocates memory, but it does not initialize it to all zeros. Instead, make initializes the memory to the zero value of the type being allocated. For example, if you create a new []int with make, the memory returned will be initialized to an empty slice.The difference between new and make is important to understand because it can affect the security of your code. If you allocate memory with new and do not initialize it further, then there is a risk that the memory could contain sensitive data. For example, if you allocate memory for a user's password with new, and then do not initialize the memory, then the password could be leaked to an attacker.The make function is generally safer than new because it initializes the memory to the zero value of the type being allocated. This means that there is less risk of sensitive data being leaked.
Difference between go and make