github.com/saucelabs/saucectl@v0.175.1/internal/slice/slice_test.go (about) 1 package slice 2 3 import ( 4 "fmt" 5 ) 6 7 func ExampleJoin_strings() { 8 fmt.Println(Join([]string{"a", "b", "c"}, ",")) 9 // Output: a,b,c 10 } 11 12 func ExampleJoin_ints() { 13 fmt.Println(Join([]int{1, 2, 3}, ",")) 14 // Output: 1,2,3 15 } 16 17 func ExampleJoin_interfaces() { 18 fmt.Println(Join([]interface{}{"a", "b", "c"}, ",")) 19 // Output: a,b,c 20 } 21 22 func ExampleJoin_string() { 23 fmt.Println(Join("hello", ",")) 24 // Output: hello 25 } 26 27 func ExampleJoin_struct() { 28 type Person struct { 29 Name string 30 } 31 fmt.Println(Join(Person{Name: "Someone Else"}, ",")) 32 // Output: {Someone Else} 33 }