The first one is a type conversion, not the second. On Thu, Aug 17, 2017, 14:59 Soumya Mukherjee <kokhonom...@gmail.com> wrote:
> Thank you both. I did not realize the latter syntax is that of a type > conversion. > > On Thursday, August 17, 2017 at 1:43:45 PM UTC-4, Axel Wagner wrote: >> >> >> >> On Thu, Aug 17, 2017 at 6:09 PM, Soumya Mukherjee <kokho...@gmail.com> >> wrote: >> >>> I am new to Golang. What is/are the difference(s) between the following >>> declarations? >>> >>> []T(nil) >>> >>> and >>> >>> []T {} >>> >>> Both seem to work identically for me. >>> >> >> https://play.golang.org/p/g6EFru8hUU >> Literally the only difference. >> >> >>> Also, I was not aware of the first syntax ([]T(nil). Can someone point >>> me to the Go document where this is introduced? >>> >> >> https://golang.org/ref/spec#Conversions >> >> > -- >>> You received this message because you are subscribed to the Google >>> Groups "golang-nuts" group. >>> >> To unsubscribe from this group and stop receiving emails from it, send an >>> email to golang-nuts...@googlegroups.com. >> >> >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.