package main
import (
"bytes"
"fmt"
)
func main() {
slice_1 := []byte{
'G'
,
'E'
,
'E'
,
'K'
,
'S'
,
'F'
,
'o'
,
'r'
,
'G'
,
'E'
,
'E'
,
'K'
,
'S'
}
slice_2 := []byte{
'A'
,
'P'
,
'P'
,
'L'
,
'E'
}
res1 := bytes.HasSuffix(slice_1, []byte(
"S"
))
res2 := bytes.HasSuffix(slice_2, []byte(
"O"
))
res3 := bytes.HasSuffix([]byte(
"Hello! I am Apple."
), []byte(
"Hello"
))
res4 := bytes.HasSuffix([]byte(
"Hello! I am Apple."
), []byte(
"Apple."
))
res5 := bytes.HasSuffix([]byte(
"Hello! I am Apple."
), []byte(
"."
))
res6 := bytes.HasSuffix([]byte(
"Hello! I am Apple."
), []byte(
"P"
))
res7 := bytes.HasSuffix([]byte(
"Geeks"
), []byte(
""
))
fmt.Println(
"Result_1: "
, res1)
fmt.Println(
"Result_2: "
, res2)
fmt.Println(
"Result_3: "
, res3)
fmt.Println(
"Result_4: "
, res4)
fmt.Println(
"Result_5: "
, res5)
fmt.Println(
"Result_6: "
, res6)
fmt.Println(
"Result_7: "
, res7)
}