Skip to content

Commit bbea6ff

Browse files
committed
src/os: export correct values for os.DevNull for each OS
This commit introduces `os.DevNull` exports for all supported OS targets.
1 parent 7e647a5 commit bbea6ff

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/os/file_anyos.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ var (
2626
Stderr = NewFile(uintptr(syscall.Stderr), "/dev/stderr")
2727
)
2828

29-
const DevNull = "/dev/null"
30-
3129
// isOS indicates whether we're running on a real operating system with
3230
// filesystem support.
3331
const isOS = true

src/os/file_other.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var (
1515
Stderr = NewFile(2, "/dev/stderr")
1616
)
1717

18+
const DevNull = "/dev/null"
19+
1820
// isOS indicates whether we're running on a real operating system with
1921
// filesystem support.
2022
const isOS = false

src/os/file_unix.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212
"syscall"
1313
)
1414

15+
const DevNull = "/dev/null"
16+
1517
type syscallFd = int
1618

1719
// fixLongPath is a noop on non-Windows platforms.

src/os/file_windows.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"unicode/utf16"
1414
)
1515

16+
const DevNull = "NUL"
17+
1618
type syscallFd = syscall.Handle
1719

1820
// Symlink is a stub, it is not implemented.

0 commit comments

Comments
 (0)