Hacker News new | ask | show | jobs
by WalterBright 2245 days ago
You don't have to wait for the compiler to complain. Using:

    pragma(msg, T);
where T is any type will print the type to the screen during compilation. pragma(msg) will print all kinds of things, making it a very handy tool to visualize what is happening while compiling. I use it all the time.
1 comments

Print-debug you program before it's even compiled and even have a bug is a bag idea.
Why so?
You shouldn't need to reverse-engineer your own program just to understand the code you wrote yourself.
I salute those who never have to debug their own code :-)
Apparently it is a common Go pattern to discover which interfaces a type implements.