Golang func - return type
<p>This is my first <code>Golang</code> program after 'Hello world'. Please find following code block which aims to perform basic arithmetic and multiple type return demo. This is just a hypothetical sample to learn <code>Go func</code>. However, I am getting following exception on compilation. From exception, i assume, operations on <code>int8</code> operand return <code>int16/int32</code> as return type and which is not correct as per go.</p>

<p><strong>Question:</strong> Isn't it safe for language to assume <code>int8</code> is safely assignable to <code>int16</code> or <code>int32</code></p>

<pre><code>package main
import (
    "fmt"
)
func Arithmetic(a,b int8) (int8,string,int16,int32){
    return a-b, "add",a*b,a/b
}
func main() {
    a,b,c,d :=Arithmetic(5,10)
    fmt.Println(a,b,c,d)
}
</code></pre>

<p><strong>Error:</strong></p>

<pre><code>C:/Go\bin\go.exe run C:/GoWorkspace/src/tlesource/ff.go
# command-line-arguments
.\ff.go:15: cannot use a * b (type int8) as type int16 in return argument
.\ff.go:15: cannot use a / b (type int8) as type int32 in return argument

Process finished with exit code 2
</code></pre>