Idiomatic way to do conversion/type assertion on multiple return values in Go

You can’t do it in a single line.
Your temporary variable approach is the way to go.

By the way, is it called casting when it comes to interfaces?

It is actually called a type assertion.
A type cast conversion is different:

var a int
var b int64

a = 5
b = int64(a)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)