I want to convert a slice of []int64 to []uint64, what is the most efficient and elegant way? I just know the below way:
func convert(userIDs ...int64) []uint64 {
uIDs := make([]uint64, len(userIDs))
for index, uID := range userIDs {
uIDs[index] = uint64(uID)
}
fmt.Printf("%T, %v\n", uIDs, uIDs)
return uIDs
}