due (from a go perspective). I figured I would write the comments here so
they are potentially googleable.
The built-in types are not keywords, so you can define a variable called
"string" or "float64". This can be useful, but it can also lead to
confusing errors when you've forgotten commas in your function arguments.
For example, declaring the function:
func Foo(float64 float64) (float64){
var b float64 = 5.0
return b
}
returns the error " float64 is not a type ". This is because in the
declaration of the function, float64 is the name of a float64; to the
compiler it is like the function was declared as Foo(num float64).
Similarly, if you forget a comma in a function type, it may seem like
arguments are disappearing as in the first error of
http://play.golang.org/p/XOayR2L1ay , but it's just that the compiler drops
the identifiers in the function type when returning the error.
(to help googling)
int is not a type
string is not a type
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.