Fix

"cannot use X (type Y) as type Z" in Go

Fix Go type mismatch errors by explicitly casting values or using type assertions to match the expected type.

The "cannot use X (type Y) as type Z" error occurs because Go is a statically typed language and does not allow implicit conversion between incompatible types. You must explicitly convert the value to the target type using a type assertion or a cast.

// If X is an interface holding Y, assert it to Z
val, ok := X.(Z)

// If X and Z are basic types, cast explicitly
val := Z(X)