debian/go/src/github.com/gohugoio/go-i18n/v2/goi18n/common_test.go
raw| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "os" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | func mustTempDir(prefix string) string { |
| 9 | outdir, err := os.MkdirTemp("", prefix) |
| 10 | if err != nil { |
| 11 | panic(err) |
| 12 | } |
| 13 | return outdir |
| 14 | } |
| 15 | |
| 16 | func mustRemoveAll(t *testing.T, path string) { |
| 17 | if err := os.RemoveAll(path); err != nil { |
| 18 | t.Fatal(err) |
| 19 | } |
| 20 | } |