github.com/hedzr/evendeep@v0.4.8/internal/tool/tool_old.go (about) 1 // g/o:build !go1.18 2 // +/build !go1.18 3 4 package tool 5 6 // ReverseSlice reverse any slice/array. 7 func ReverseSlice(s interface{}) { ReverseAnySlice(s) } 8 9 // ReverseStringSlice reverse a string slice. 10 func ReverseStringSlice(s []string) []string { 11 for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { 12 s[i], s[j] = s[j], s[i] 13 } 14 return s 15 }