Check how a string starts or ends:
path := "/home/user/file.txt"
fmt.Println(strings.HasPrefix(path, "/home")) // true
fmt.Println(strings.HasSuffix(path, ".txt")) // true
These functions are useful for validating paths, URLs, and file extensions. They're more readable than slicing and comparing manually.