Skip to content

Instantly share code, notes, and snippets.

@clone1018
Last active December 28, 2015 08:29
Show Gist options
  • Save clone1018/7472233 to your computer and use it in GitHub Desktop.
Save clone1018/7472233 to your computer and use it in GitHub Desktop.
var PATHS = []string{filepath.Join("y:", "Web Product Photography", "001_RFU", "NonBrands"),
filepath.Join("y:", "Web Product Photography", "001_RFU", "Brands", "FENDI"),
filepath.Join("y:", "Web Product Photography", "001_RFU", "Brands", "HOT KISS"),
filepath.Join("y:", "Web Product Photography", "001_RFU", "Brands", "NIKE"),
filepath.Join("y:", "Web Product Photography", "001_RFU", "Brands", "SOPHIA LOREN")}
func findFrame(sku string) (string, error) {
for i := 0; i < len(PATHS); i++ {
path := PATHS[i]
dir, _ := ioutil.ReadDir(path)
for i := 0; i < len(dir); i++ {
file := dir[i]
if file.Name() == sku {
return filepath.Join(path, file.Name()), nil
}
}
}
return "", errors.New("Folder not found")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment