e.g.
a/b/c* -> a/b
a/b/c*/*/*b -> a/b
Why I need this is because I want to get the abs path of globed filename. Code example:
files, _ := filepath.Glob(p)
top := __magic here__
for _, f := range files {
abs, _ := filepath.Abs(path.Join(top, f))
fmt.Println(abs)
}
Is there any exists method for this purpose? otherwise I have to implement by myself.
EDIT
The magic is make glob path abs first, then the glob return abs path.