Browse Source

Make isTerminal un-exported

tags/v1.4.1
Andrey Tcherepanov 6 months ago
parent
commit
ede5b639cd
3 changed files with 5 additions and 7 deletions
  1. 2
    2
      terminal_check_bsd.go
  2. 1
    3
      terminal_check_notappengine.go
  3. 2
    2
      terminal_check_unix.go

+ 2
- 2
terminal_check_bsd.go View File

@@ -1,12 +1,12 @@
1 1
 // +build darwin dragonfly freebsd netbsd openbsd
2 2
 
3
-package terminal
3
+package logrus
4 4
 
5 5
 import "golang.org/x/sys/unix"
6 6
 
7 7
 const ioctlReadTermios = unix.TIOCGETA
8 8
 
9
-func IsTerminal(fd int) bool {
9
+func isTerminal(fd int) bool {
10 10
 	_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
11 11
 	return err == nil
12 12
 }

+ 1
- 3
terminal_check_notappengine.go View File

@@ -5,14 +5,12 @@ package logrus
5 5
 import (
6 6
 	"io"
7 7
 	"os"
8
-
9
-	"github.com/sirupsen/logrus/terminal"
10 8
 )
11 9
 
12 10
 func checkIfTerminal(w io.Writer) bool {
13 11
 	switch v := w.(type) {
14 12
 	case *os.File:
15
-		return terminal.IsTerminal(int(v.Fd()))
13
+		return isTerminal(int(v.Fd()))
16 14
 	default:
17 15
 		return false
18 16
 	}

+ 2
- 2
terminal_check_unix.go View File

@@ -1,12 +1,12 @@
1 1
 // +build linux aix
2 2
 
3
-package terminal
3
+package logrus
4 4
 
5 5
 import "golang.org/x/sys/unix"
6 6
 
7 7
 const ioctlReadTermios = unix.TCGETS
8 8
 
9
-func IsTerminal(fd int) bool {
9
+func isTerminal(fd int) bool {
10 10
 	_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
11 11
 	return err == nil
12 12
 }

Loading…
Cancel
Save