// Go program to illustrate the concept
// of the index in the slice of bytes
package main
import (
"bytes"
"fmt"
)
func main() {
// Creating and initializing
// the slice of bytes
// Using shorthand declaration
slice_1 := []byte{'!', '!', 'G', 'e', 'e', 'k', 's', 'f',
'o', 'r', 'G', 'e', 'e', 'k', 's', '#', '#'}
slice_2 := []byte{'A', 'p', 'p', 'l', 'e'}
slice_3 := []byte{'%', 'g', 'e', 'e', 'k', 's', '%'}
// Displaying slices
fmt.Println("Original Slice:")
fmt.Printf("Slice 1: %s", slice_1)
fmt.Printf("\nSlice 2: %s", slice_2)
fmt.Printf("\nSlice 3: %s", slice_3)
// Finding the index of
// the slice of bytes
// Using IndexAny function
res1 := bytes.IndexAny(slice_1, "eks")
res2 := bytes.IndexAny(slice_2, "lqzxm")
res3 := bytes.IndexAny(slice_3, "xxxxx")
// Display the results
fmt.Printf("\n\nLast Index:\n")
fmt.Printf("\nSlice 1: %d", res1)
fmt.Printf("\nSlice 2: %d", res2)
fmt.Printf("\nSlice 3: %d", res3)
}