Go Pass Func to Struct like fields, Error “too few values in struct literal of type Test”
type Test struct { a int b int } func f(a, b int) (int, int) { return a, b } k := Test{(f(5, 6))} // Error but type Test struct { a int } func f(a int) int { return a } k := Test{(f(5))} // Ok How send func result to struct fields, or […]
Go Pass Func to Struct like fields Error “too few values in struct literal of type Test”
type Test struct {
a int
b int
}