Last active
December 28, 2015 08:29
-
-
Save clone1018/7472233 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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