Go's type system doesn't, but the compiler will in a good number of cases. For example, this will produce a compile time error:
value, err := Foo() fmt.Println(value)
The following defeats this check though:
value, _ := Foo() // Bar returns one value: an error _ = Bar() Bar()
Go's type system doesn't, but the compiler will in a good number of cases. For example, this will produce a compile time error:
It produces an error because `err` was declared and unused.The following defeats this check though:
The above list probably isn't exhaustive.