Instead of hard coding a case for one type of slice, you could use reflect.DeepEqual() to do the comparison (which will work as long as the element types are equal, and it will work for slices of all types).