Skip to content

Commit 94d9371

Browse files
os: clarify that OpenFile reqires one of O_RDONLY/O_WRONLY/O_RDWR
Fixes #21322. Change-Id: Ia589c576be0b5cdb7cde5d35cd857ad7c93c372b Reviewed-on: https://go-review.googlesource.com/74550 Reviewed-by: Robert Griesemer <gri@golang.org>
1 parent c280126 commit 94d9371

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/os/file.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ var (
6060
)
6161

6262
// Flags to OpenFile wrapping those of the underlying system. Not all
63-
// flags may be implemented on a given system.
63+
// flags may be implemented on a given system. Each call to OpenFile
64+
// should specify exactly one of O_RDONLY, O_WRONLY, or O_RDWR.
6465
const (
6566
O_RDONLY int = syscall.O_RDONLY // open the file read-only.
6667
O_WRONLY int = syscall.O_WRONLY // open the file write-only.

0 commit comments

Comments
 (0)