I have a structure:
type xyz struct {
x int
y string
}
func f(){
x := new(xyz) //allocating memory
}
But I cannot find any method to deallocate it in go.
Go is garbage collected language. You do not have to deallocate memory.
Articles on memory allocation and deallocation in Go.