Tigraine

Daniel Hoelbling-Inzko talks about programming

Golang: int is not a type

Posted by Daniel Hölbling on June 6, 2017

Today I ran into a very interesting compiler error in my go program: int is not a type. Although the same lines of code that didn't compile worked a few minutes earlier.

It took me 20 minutes to figure it out. I was already halfway through a forum post on the golangbridge forums and trying to put together a minimal example when I noticed the problem. Apparently I had a typo in mit func init() and had inadvertently called it func int()!

The go compiler didn't even complain with me overriding one of it's core types.

Filed under golang
comments powered by Disqus

My Photography business

Projects

dynamic css for .NET

Archives

more