I have this bit while trying to understand filepath.Glob
for _, v := range ListofPaths{
exists, _ := filepath.Glob(fmt.Sprintf("%s/*/%s", v, filename))
}
Which works for any path
ListofPathsPath/any/dot/thing/filename.ext
but not
ListofPathsPath/filename.ext
so from the above I need to match glob %s/%s or %s/*/%s
Is there a way to phrase this? I don't fully get the filepath.Match syntax yet and haven't found any comprehensive examples.
This is really basic shell syntax, you can't do that.
You will have to either call glob twice or just use filepath.Walk
.