Skip to content

Commit

Permalink
Removes out-of-date TODOs in platform.File (tetratelabs#1474)
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt authored May 16, 2023
1 parent bc96257 commit 41c4ed5
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions internal/platform/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@ type File interface {
// - Some implementations implement this with a cached call to Stat.
Ino() (uint64, syscall.Errno)

// IsNonblock returns true if SetNonblock was successfully enabled on this
// file.
// IsNonblock returns true if the file was opened with O_NONBLOCK, or
// SetNonblock was successfully enabled on this file.
//
// # Notes
//
// - This may not match the underlying state of the file descriptor if it
// was opened (OpenFile) in non-blocking mode.
// - This might not match the underlying state of the file descriptor if
// the file was not opened via OpenFile.
IsNonblock() bool
// ^-- TODO: We should be able to cache the open flag and remove this note.

// SetNonblock toggles the non-blocking mode of this file.
// SetNonblock toggles the non-blocking mode (O_NONBLOCK) of this file.
//
// # Errors
//
Expand All @@ -62,20 +61,20 @@ type File interface {
//
// # Notes
//
// - This is like syscall.SetNonblock and `fcntl` with `O_NONBLOCK` in
// - This is like syscall.SetNonblock and `fcntl` with O_NONBLOCK in
// POSIX. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
SetNonblock(enable bool) syscall.Errno

// IsAppend returns true if SetAppend was successfully enabled on this file.
// IsAppend returns true if the file was opened with syscall.O_APPEND, or
// SetAppend was successfully enabled on this file.
//
// # Notes
//
// - This might not match the underlying state of the file descriptor if
// it was opened (OpenFile) in append mode.
// the file was not opened via OpenFile.
IsAppend() bool
// ^-- TODO: We should be able to cache the open flag and remove this note.

// SetAppend toggles the append mode of this file.
// SetAppend toggles the append mode (syscall.O_APPEND) of this file.
//
// # Errors
//
Expand Down

0 comments on commit 41c4ed5

Please sign in to comment.