full path: views/admin/users.html
trim set (views): /admin/users.html
trim set (views/): admin/users.html
full path: views/index.html
trim set (views): /index.html
trim set (views/): ndex.html
Heres my code:
err := filepath.Walk("./views", func(path string, info os.FileInfo, err error) error {
if strings.Contains(path, ".html") {
bytes, err := ioutil.ReadFile(path)
if err != nil {
panic(err)
}
fmt.Println("full path:", path)
fmt.Println("trim set (views):", strings.Trim(path, "views"))
fmt.Println("trim set (views/):", strings.Trim(path, "views/"))
}
}
Have I lost my mind? Does the forward slash have something to do with this? Please explain what's going on if you know.