Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: go/src/infra/libs/infra_util/test_utils.go

Issue 662113003: Drover's back, baby! (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git/+/master
Patch Set: more tests and refactors Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 package infra_util
2
3 import (
4 "io/ioutil"
5 "os"
6 )
7
8 func WithTempDir(dir, name string, f func(tmpdir string)) {
9 var pval interface{}
10 d, err := ioutil.TempDir(dir, name)
11 if err != nil {
12 panic(err)
13 }
14 func() {
15 defer func() { pval = recover() }()
16 f(d)
17 }()
18 err = os.RemoveAll(d)
19 if err != nil {
20 panic(err)
21 }
22 if pval != nil {
23 panic(pval)
24 }
25 }
OLDNEW
« no previous file with comments | « go/src/infra/libs/infra_util/stringSet.go ('k') | go/src/infra/tools/drover/default_shell_darwin.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698