aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqiulaidongfeng <2645477756@qq.com>2024-02-27 13:54:42 +0000
committerGopher Robot <gobot@golang.org>2024-03-04 13:37:12 +0000
commitb414d044ff6d24ff23531e64d45ad775bc6c96bb (patch)
treeef59abc9a984ef25026bb83f224b50150919e220
parent6f5d77454e31be8af11a7e2bcda36d200fda07c5 (diff)
downloadgo-b414d044ff6d24ff23531e64d45ad775bc6c96bb.tar.xz
os: remove if nil!=nil in openFileNolog
Change-Id: I21cecc13570f3b61f3d6c4fede18dc63ddca1b69 GitHub-Last-Rev: 3c351e4aa84780d682fd7595ac2091defdcdfc62 GitHub-Pull-Request: golang/go#65958 Reviewed-on: https://go-review.googlesource.com/c/go/+/567355 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
-rw-r--r--src/os/file_windows.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/os/file_windows.go b/src/os/file_windows.go
index 51dbc355f8..22fd9e5d40 100644
--- a/src/os/file_windows.go
+++ b/src/os/file_windows.go
@@ -115,11 +115,7 @@ func openFileNolog(name string, flag int, perm FileMode) (*File, error) {
}
return nil, &PathError{Op: "open", Path: name, Err: e}
}
- f, e := newFile(r, name, "file"), nil
- if e != nil {
- return nil, &PathError{Op: "open", Path: name, Err: e}
- }
- return f, nil
+ return newFile(r, name, "file"), nil
}
func (file *file) close() error {