It's unnecessary to to call atomic.AddInt32 since there is a mutex lock.
Change-Id: I31fcece17c34f99a95772d744aebd3f6a8cf1d23
Reviewed-on: https://go-review.googlesource.com/c/go/+/426081
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
})
}
}
+
+ if c.tempDirErr == nil {
+ c.tempDirSeq++
+ }
+ seq := c.tempDirSeq
c.tempDirMu.Unlock()
if c.tempDirErr != nil {
c.Fatalf("TempDir: %v", c.tempDirErr)
}
- seq := atomic.AddInt32(&c.tempDirSeq, 1)
+
dir := fmt.Sprintf("%s%c%03d", c.tempDir, os.PathSeparator, seq)
if err := os.Mkdir(dir, 0777); err != nil {
c.Fatalf("TempDir: %v", err)