mirror of
https://github.com/golang/go
synced 2024-11-02 09:03:03 +00:00
os: don't repeat dir argument in CreateTemp error
The dir argument is already in prefix, we shouldn't add it again. Change-Id: I42a158bec3a43950fce24f57b808da3ad8c5ef5b Reviewed-on: https://go-review.googlesource.com/c/go/+/383636 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
1d6051380c
commit
334a591a3f
1 changed files with 1 additions and 1 deletions
|
@ -46,7 +46,7 @@ func CreateTemp(dir, pattern string) (*File, error) {
|
|||
if try++; try < 10000 {
|
||||
continue
|
||||
}
|
||||
return nil, &PathError{Op: "createtemp", Path: dir + string(PathSeparator) + prefix + "*" + suffix, Err: ErrExist}
|
||||
return nil, &PathError{Op: "createtemp", Path: prefix + "*" + suffix, Err: ErrExist}
|
||||
}
|
||||
return f, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue