- fmt.Println(path.Join(cwdRel, strings.Repeat("..", upLevels), doFile))
+ p := make([]string, 0, upLevels+2)
+ p = append(p, cwd)
+ for i := 0; i < upLevels; i++ {
+ p = append(p, "..")
+ }
+ p = append(p, doFile)
+ rel, err := filepath.Rel(Cwd, path.Join(p...))
+ if err != nil {
+ panic(err)
+ }
+ fmt.Println(rel)