import "sort" //... sort.SearchInts([]int{0,1,4,5,6,7,8,9}, 6) // evaluates to 4