(path ...string)
| 77 | } |
| 78 | |
| 79 | func (f *TempDirFixture) JoinPath(path ...string) string { |
| 80 | p := []string{} |
| 81 | isAbs := len(path) > 0 && filepath.IsAbs(path[0]) |
| 82 | if isAbs { |
| 83 | if !strings.HasPrefix(path[0], f.Path()) { |
| 84 | f.t.Fatalf("Path outside fixture tempdir are forbidden: %s", path[0]) |
| 85 | } |
| 86 | } else { |
| 87 | p = append(p, f.Path()) |
| 88 | } |
| 89 | |
| 90 | p = append(p, path...) |
| 91 | return filepath.Join(p...) |
| 92 | } |
| 93 | |
| 94 | func (f *TempDirFixture) JoinPaths(paths []string) []string { |
| 95 | joined := make([]string, len(paths)) |