I trying to learn error handling in golang to understand how error handling works. I have the following code:
var a int8
var b int32
var err error
c := a + b //types mismatched error
if err != nil {
fmt.Println(err)
}
when I try to run this from within vim with :GoRun
I get types mismatched error.
My question is how do I catch that error and print message to screen if this is even possible as the error occurs during compiling?