new allocates nullified storage for a new element or something, and then returns a pointer to it. I don't think it really matters if you use new vs short variable declaration := type{} , this is basically just a preference
As for pointer2 , the pointer2 variable contains its own data when you do
// initializing a zeroed 'passport in memory' pointerp2 := new(passport) // setting the field Name to whatever pointerp2.Name = "Anotherscott"
new allocates the nullified storage in memory and returns a pointer to it, therefore, in short, the new one returns a pointer to everything you do, therefore pointerp2 returns &{ Anotherscott }
Basically you want to use pointers when you pass a variable around that you need to change (but be careful with data races using mutexes or pipes. If you need to read and write a variable from different functions)
The usual method that people use instead of new simply shortens the type of pointer:
blah := &passport{}
blah is now a pointer to a passport type
You can see on this playground:
http://play.golang.org/p/9OuM2Kqncq
When passing a pointer, you can change the original value. When transferring a non pointer, you cannot change it. This is because go variables are passed as a copy. Thus, in the iDontTakeAPointer function iDontTakeAPointer he receives a copy of the tester structure, then modifies the name field and then returns that it does nothing for us, since it changes the copy, not the original.
source share