Consider 3 examples:
[]int64 with 2 elements as argument .OrderBy(db.Raw("CASE WHEN id IN ? THEN 0 ELSE 1 END", []int64{1000, 2000})
[]int64 with 1 element as argument .OrderBy(db.Raw("CASE WHEN id IN ? THEN 0 ELSE 1 END", []int64{1000})
[]int64 with 0 elements as argument .OrderBy(db.Raw("CASE WHEN id IN ? THEN 0 ELSE 1 END", []int64{})
All 3 generate the same, correct SQL:
ORDER BY CASE WHEN id IN $3 THEN 0 ELSE 1 END
1st example is correct and works
2nd example passes the only element of the slice instead of the slice
3rd example does not pass the argument at all