x := (*int64)(unsafe.Pointer(uintptr(rand.Int63n(math.MaxUint64))))
-
-
- Kraj razgovora
Novi razgovor -
-
-
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
thing{} will allocate on the stack which is better than the heap (less gargabe, better locality, etc) but will automatically allocate on the heap if deemed necessary by the compiler (if the variable "escapes") - smarter than just forcing a heap allocation with &thing{} or new()
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
make(map[string]interface{})
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
After long discussion a coworker of mine and I agreed you should not use &thing except in a return of a 'NewX' constructor. Prefer 'var x thing' if you want the zero value, 'thing{}' if you are setting values
-
The reason to not use '&thing{}' often is that you should explicitly share.
Kraj razgovora
Novi razgovor -
-
-
It depends, however I have never used new. All the others, though address of struct literal less often
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
Tweet je nedostupan.
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.