Re: [go-nuts] Mismatched types work sometimes?

2019-02-11 Thread Jamie Caldwell
Cheers Rob, I'll certainly read that. On Mon, 11 Feb 2019 at 20:53, Rob Pike wrote: > You might find blog.golang.org/constants helpful. > > -rob > > > On Tue, Feb 12, 2019 at 5:04 AM Jamie Caldwell < > mr.jamie.caldw...@gmail.com> wrote: > >> Thanks for the help and quick response Tyler. >> >>

Re: [go-nuts] Mismatched types work sometimes?

2019-02-11 Thread Rob Pike
You might find blog.golang.org/constants helpful. -rob On Tue, Feb 12, 2019 at 5:04 AM Jamie Caldwell wrote: > Thanks for the help and quick response Tyler. > > On Mon, 11 Feb 2019 at 17:56, Tyler Compton wrote: > >> Constant expressions like 'A' or 3 or named constants like "const x = 7" >>

Re: [go-nuts] Mismatched types work sometimes?

2019-02-11 Thread Jamie Caldwell
Thanks for the help and quick response Tyler. On Mon, 11 Feb 2019 at 17:56, Tyler Compton wrote: > Constant expressions like 'A' or 3 or named constants like "const x = 7" > are what Go calls "untyped constants". The type of these constants are > determined by the context in which they're used.

Re: [go-nuts] Mismatched types work sometimes?

2019-02-11 Thread Tyler Compton
Constant expressions like 'A' or 3 or named constants like "const x = 7" are what Go calls "untyped constants". The type of these constants are determined by the context in which they're used. For example: const myConst = 3 myFloat := 2.5 fmt.Println(myFloat + myConst) fmt.Println(myFloat + 3)

[go-nuts] Mismatched types work sometimes?

2019-02-11 Thread Jamie Caldwell
Hello, Can you help? https://play.golang.org/p/XfJZ3h06p60 Why does 'A' work, when first assigning it to a variable doesn't? Thank you, Jamie. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving