0
type TCustomIntType int

func aFunc() {
    var fails []TCustomIntType = []TCustomIntType([]int{})
}

I got:

cannot convert []int literal (type []int) to type []TCustomIntType

How to fix it? Do I have to write a convert func manually?

tom10271
  • 4,222
  • 5
  • 33
  • 62

1 Answers1

2

Yes, you have to copy it manually with a for loop.

Emil
  • 2,098
  • 11
  • 25