浏览代码

remove color-related dependencies

tags/v2.1.0-rc1
Shivaram Lingamneni 4 年前
父节点
当前提交
867b233585
共有 30 个文件被更改,包括 0 次插入2087 次删除
  1. 0
    3
      go.mod
  2. 0
    9
      vendor/github.com/mattn/go-colorable/.travis.yml
  3. 0
    21
      vendor/github.com/mattn/go-colorable/LICENSE
  4. 0
    48
      vendor/github.com/mattn/go-colorable/README.md
  5. 0
    29
      vendor/github.com/mattn/go-colorable/colorable_appengine.go
  6. 0
    30
      vendor/github.com/mattn/go-colorable/colorable_others.go
  7. 0
    1005
      vendor/github.com/mattn/go-colorable/colorable_windows.go
  8. 0
    3
      vendor/github.com/mattn/go-colorable/go.mod
  9. 0
    4
      vendor/github.com/mattn/go-colorable/go.sum
  10. 0
    55
      vendor/github.com/mattn/go-colorable/noncolorable.go
  11. 0
    13
      vendor/github.com/mattn/go-isatty/.travis.yml
  12. 0
    9
      vendor/github.com/mattn/go-isatty/LICENSE
  13. 0
    50
      vendor/github.com/mattn/go-isatty/README.md
  14. 0
    2
      vendor/github.com/mattn/go-isatty/doc.go
  15. 0
    5
      vendor/github.com/mattn/go-isatty/go.mod
  16. 0
    4
      vendor/github.com/mattn/go-isatty/go.sum
  17. 0
    23
      vendor/github.com/mattn/go-isatty/isatty_android.go
  18. 0
    24
      vendor/github.com/mattn/go-isatty/isatty_bsd.go
  19. 0
    15
      vendor/github.com/mattn/go-isatty/isatty_others.go
  20. 0
    22
      vendor/github.com/mattn/go-isatty/isatty_plan9.go
  21. 0
    22
      vendor/github.com/mattn/go-isatty/isatty_solaris.go
  22. 0
    19
      vendor/github.com/mattn/go-isatty/isatty_tcgets.go
  23. 0
    125
      vendor/github.com/mattn/go-isatty/isatty_windows.go
  24. 0
    1
      vendor/github.com/mgutz/ansi/.gitignore
  25. 0
    9
      vendor/github.com/mgutz/ansi/LICENSE
  26. 0
    121
      vendor/github.com/mgutz/ansi/README.md
  27. 0
    285
      vendor/github.com/mgutz/ansi/ansi.go
  28. 0
    65
      vendor/github.com/mgutz/ansi/doc.go
  29. 0
    57
      vendor/github.com/mgutz/ansi/print.go
  30. 0
    9
      vendor/modules.txt

+ 0
- 3
go.mod 查看文件

@@ -9,9 +9,6 @@ require (
9 9
 	github.com/go-sql-driver/mysql v1.5.0
10 10
 	github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940 // indirect
11 11
 	github.com/goshuirc/irc-go v0.0.0-20200311142257-57fd157327ac
12
-	github.com/mattn/go-colorable v0.1.4
13
-	github.com/mattn/go-isatty v0.0.10 // indirect
14
-	github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
15 12
 	github.com/onsi/ginkgo v1.12.0 // indirect
16 13
 	github.com/onsi/gomega v1.9.0 // indirect
17 14
 	github.com/oragono/confusables v0.0.0-20190624102032-fe1cf31a24b0

+ 0
- 9
vendor/github.com/mattn/go-colorable/.travis.yml 查看文件

@@ -1,9 +0,0 @@
1
-language: go
2
-go:
3
-  - tip
4
-
5
-before_install:
6
-  - go get github.com/mattn/goveralls
7
-  - go get golang.org/x/tools/cmd/cover
8
-script:
9
-  - $HOME/gopath/bin/goveralls -repotoken xnXqRGwgW3SXIguzxf90ZSK1GPYZPaGrw

+ 0
- 21
vendor/github.com/mattn/go-colorable/LICENSE 查看文件

@@ -1,21 +0,0 @@
1
-The MIT License (MIT)
2
-
3
-Copyright (c) 2016 Yasuhiro Matsumoto
4
-
5
-Permission is hereby granted, free of charge, to any person obtaining a copy
6
-of this software and associated documentation files (the "Software"), to deal
7
-in the Software without restriction, including without limitation the rights
8
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
-copies of the Software, and to permit persons to whom the Software is
10
-furnished to do so, subject to the following conditions:
11
-
12
-The above copyright notice and this permission notice shall be included in all
13
-copies or substantial portions of the Software.
14
-
15
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
-SOFTWARE.

+ 0
- 48
vendor/github.com/mattn/go-colorable/README.md 查看文件

@@ -1,48 +0,0 @@
1
-# go-colorable
2
-
3
-[![Godoc Reference](https://godoc.org/github.com/mattn/go-colorable?status.svg)](http://godoc.org/github.com/mattn/go-colorable)
4
-[![Build Status](https://travis-ci.org/mattn/go-colorable.svg?branch=master)](https://travis-ci.org/mattn/go-colorable)
5
-[![Coverage Status](https://coveralls.io/repos/github/mattn/go-colorable/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-colorable?branch=master)
6
-[![Go Report Card](https://goreportcard.com/badge/mattn/go-colorable)](https://goreportcard.com/report/mattn/go-colorable)
7
-
8
-Colorable writer for windows.
9
-
10
-For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.)
11
-This package is possible to handle escape sequence for ansi color on windows.
12
-
13
-## Too Bad!
14
-
15
-![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png)
16
-
17
-
18
-## So Good!
19
-
20
-![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png)
21
-
22
-## Usage
23
-
24
-```go
25
-logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true})
26
-logrus.SetOutput(colorable.NewColorableStdout())
27
-
28
-logrus.Info("succeeded")
29
-logrus.Warn("not correct")
30
-logrus.Error("something error")
31
-logrus.Fatal("panic")
32
-```
33
-
34
-You can compile above code on non-windows OSs.
35
-
36
-## Installation
37
-
38
-```
39
-$ go get github.com/mattn/go-colorable
40
-```
41
-
42
-# License
43
-
44
-MIT
45
-
46
-# Author
47
-
48
-Yasuhiro Matsumoto (a.k.a mattn)

+ 0
- 29
vendor/github.com/mattn/go-colorable/colorable_appengine.go 查看文件

@@ -1,29 +0,0 @@
1
-// +build appengine
2
-
3
-package colorable
4
-
5
-import (
6
-	"io"
7
-	"os"
8
-
9
-	_ "github.com/mattn/go-isatty"
10
-)
11
-
12
-// NewColorable returns new instance of Writer which handles escape sequence.
13
-func NewColorable(file *os.File) io.Writer {
14
-	if file == nil {
15
-		panic("nil passed instead of *os.File to NewColorable()")
16
-	}
17
-
18
-	return file
19
-}
20
-
21
-// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout.
22
-func NewColorableStdout() io.Writer {
23
-	return os.Stdout
24
-}
25
-
26
-// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.
27
-func NewColorableStderr() io.Writer {
28
-	return os.Stderr
29
-}

+ 0
- 30
vendor/github.com/mattn/go-colorable/colorable_others.go 查看文件

@@ -1,30 +0,0 @@
1
-// +build !windows
2
-// +build !appengine
3
-
4
-package colorable
5
-
6
-import (
7
-	"io"
8
-	"os"
9
-
10
-	_ "github.com/mattn/go-isatty"
11
-)
12
-
13
-// NewColorable returns new instance of Writer which handles escape sequence.
14
-func NewColorable(file *os.File) io.Writer {
15
-	if file == nil {
16
-		panic("nil passed instead of *os.File to NewColorable()")
17
-	}
18
-
19
-	return file
20
-}
21
-
22
-// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout.
23
-func NewColorableStdout() io.Writer {
24
-	return os.Stdout
25
-}
26
-
27
-// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.
28
-func NewColorableStderr() io.Writer {
29
-	return os.Stderr
30
-}

+ 0
- 1005
vendor/github.com/mattn/go-colorable/colorable_windows.go
文件差异内容过多而无法显示
查看文件


+ 0
- 3
vendor/github.com/mattn/go-colorable/go.mod 查看文件

@@ -1,3 +0,0 @@
1
-module github.com/mattn/go-colorable
2
-
3
-require github.com/mattn/go-isatty v0.0.8

+ 0
- 4
vendor/github.com/mattn/go-colorable/go.sum 查看文件

@@ -1,4 +0,0 @@
1
-github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw=
2
-github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
3
-golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
4
-golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

+ 0
- 55
vendor/github.com/mattn/go-colorable/noncolorable.go 查看文件

@@ -1,55 +0,0 @@
1
-package colorable
2
-
3
-import (
4
-	"bytes"
5
-	"io"
6
-)
7
-
8
-// NonColorable holds writer but removes escape sequence.
9
-type NonColorable struct {
10
-	out io.Writer
11
-}
12
-
13
-// NewNonColorable returns new instance of Writer which removes escape sequence from Writer.
14
-func NewNonColorable(w io.Writer) io.Writer {
15
-	return &NonColorable{out: w}
16
-}
17
-
18
-// Write writes data on console
19
-func (w *NonColorable) Write(data []byte) (n int, err error) {
20
-	er := bytes.NewReader(data)
21
-	var bw [1]byte
22
-loop:
23
-	for {
24
-		c1, err := er.ReadByte()
25
-		if err != nil {
26
-			break loop
27
-		}
28
-		if c1 != 0x1b {
29
-			bw[0] = c1
30
-			w.out.Write(bw[:])
31
-			continue
32
-		}
33
-		c2, err := er.ReadByte()
34
-		if err != nil {
35
-			break loop
36
-		}
37
-		if c2 != 0x5b {
38
-			continue
39
-		}
40
-
41
-		var buf bytes.Buffer
42
-		for {
43
-			c, err := er.ReadByte()
44
-			if err != nil {
45
-				break loop
46
-			}
47
-			if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' {
48
-				break
49
-			}
50
-			buf.Write([]byte(string(c)))
51
-		}
52
-	}
53
-
54
-	return len(data), nil
55
-}

+ 0
- 13
vendor/github.com/mattn/go-isatty/.travis.yml 查看文件

@@ -1,13 +0,0 @@
1
-language: go
2
-go:
3
-  - tip
4
-
5
-os:
6
-  - linux
7
-  - osx
8
-
9
-before_install:
10
-  - go get github.com/mattn/goveralls
11
-  - go get golang.org/x/tools/cmd/cover
12
-script:
13
-  - $HOME/gopath/bin/goveralls -repotoken 3gHdORO5k5ziZcWMBxnd9LrMZaJs8m9x5

+ 0
- 9
vendor/github.com/mattn/go-isatty/LICENSE 查看文件

@@ -1,9 +0,0 @@
1
-Copyright (c) Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
2
-
3
-MIT License (Expat)
4
-
5
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 50
vendor/github.com/mattn/go-isatty/README.md 查看文件

@@ -1,50 +0,0 @@
1
-# go-isatty
2
-
3
-[![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty)
4
-[![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty)
5
-[![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master)
6
-[![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty)
7
-
8
-isatty for golang
9
-
10
-## Usage
11
-
12
-```go
13
-package main
14
-
15
-import (
16
-	"fmt"
17
-	"github.com/mattn/go-isatty"
18
-	"os"
19
-)
20
-
21
-func main() {
22
-	if isatty.IsTerminal(os.Stdout.Fd()) {
23
-		fmt.Println("Is Terminal")
24
-	} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) {
25
-		fmt.Println("Is Cygwin/MSYS2 Terminal")
26
-	} else {
27
-		fmt.Println("Is Not Terminal")
28
-	}
29
-}
30
-```
31
-
32
-## Installation
33
-
34
-```
35
-$ go get github.com/mattn/go-isatty
36
-```
37
-
38
-## License
39
-
40
-MIT
41
-
42
-## Author
43
-
44
-Yasuhiro Matsumoto (a.k.a mattn)
45
-
46
-## Thanks
47
-
48
-* k-takata: base idea for IsCygwinTerminal
49
-
50
-    https://github.com/k-takata/go-iscygpty

+ 0
- 2
vendor/github.com/mattn/go-isatty/doc.go 查看文件

@@ -1,2 +0,0 @@
1
-// Package isatty implements interface to isatty
2
-package isatty

+ 0
- 5
vendor/github.com/mattn/go-isatty/go.mod 查看文件

@@ -1,5 +0,0 @@
1
-module github.com/mattn/go-isatty
2
-
3
-require golang.org/x/sys v0.0.0-20191008105621-543471e840be
4
-
5
-go 1.14

+ 0
- 4
vendor/github.com/mattn/go-isatty/go.sum 查看文件

@@ -1,4 +0,0 @@
1
-golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ=
2
-golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
3
-golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU=
4
-golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

+ 0
- 23
vendor/github.com/mattn/go-isatty/isatty_android.go 查看文件

@@ -1,23 +0,0 @@
1
-// +build android
2
-
3
-package isatty
4
-
5
-import (
6
-	"syscall"
7
-	"unsafe"
8
-)
9
-
10
-const ioctlReadTermios = syscall.TCGETS
11
-
12
-// IsTerminal return true if the file descriptor is terminal.
13
-func IsTerminal(fd uintptr) bool {
14
-	var termios syscall.Termios
15
-	_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
16
-	return err == 0
17
-}
18
-
19
-// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
20
-// terminal. This is also always false on this environment.
21
-func IsCygwinTerminal(fd uintptr) bool {
22
-	return false
23
-}

+ 0
- 24
vendor/github.com/mattn/go-isatty/isatty_bsd.go 查看文件

@@ -1,24 +0,0 @@
1
-// +build darwin freebsd openbsd netbsd dragonfly
2
-// +build !appengine
3
-
4
-package isatty
5
-
6
-import (
7
-	"syscall"
8
-	"unsafe"
9
-)
10
-
11
-const ioctlReadTermios = syscall.TIOCGETA
12
-
13
-// IsTerminal return true if the file descriptor is terminal.
14
-func IsTerminal(fd uintptr) bool {
15
-	var termios syscall.Termios
16
-	_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
17
-	return err == 0
18
-}
19
-
20
-// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
21
-// terminal. This is also always false on this environment.
22
-func IsCygwinTerminal(fd uintptr) bool {
23
-	return false
24
-}

+ 0
- 15
vendor/github.com/mattn/go-isatty/isatty_others.go 查看文件

@@ -1,15 +0,0 @@
1
-// +build appengine js nacl
2
-
3
-package isatty
4
-
5
-// IsTerminal returns true if the file descriptor is terminal which
6
-// is always false on js and appengine classic which is a sandboxed PaaS.
7
-func IsTerminal(fd uintptr) bool {
8
-	return false
9
-}
10
-
11
-// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2
12
-// terminal. This is also always false on this environment.
13
-func IsCygwinTerminal(fd uintptr) bool {
14
-	return false
15
-}

+ 0
- 22
vendor/github.com/mattn/go-isatty/isatty_plan9.go 查看文件

@@ -1,22 +0,0 @@
1
-// +build plan9
2
-
3
-package isatty
4
-
5
-import (
6
-	"syscall"
7
-)
8
-
9
-// IsTerminal returns true if the given file descriptor is a terminal.
10
-func IsTerminal(fd uintptr) bool {
11
-	path, err := syscall.Fd2path(fd)
12
-	if err != nil {
13
-		return false
14
-	}
15
-	return path == "/dev/cons" || path == "/mnt/term/dev/cons"
16
-}
17
-
18
-// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
19
-// terminal. This is also always false on this environment.
20
-func IsCygwinTerminal(fd uintptr) bool {
21
-	return false
22
-}

+ 0
- 22
vendor/github.com/mattn/go-isatty/isatty_solaris.go 查看文件

@@ -1,22 +0,0 @@
1
-// +build solaris
2
-// +build !appengine
3
-
4
-package isatty
5
-
6
-import (
7
-	"golang.org/x/sys/unix"
8
-)
9
-
10
-// IsTerminal returns true if the given file descriptor is a terminal.
11
-// see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c
12
-func IsTerminal(fd uintptr) bool {
13
-	var termio unix.Termio
14
-	err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio)
15
-	return err == nil
16
-}
17
-
18
-// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
19
-// terminal. This is also always false on this environment.
20
-func IsCygwinTerminal(fd uintptr) bool {
21
-	return false
22
-}

+ 0
- 19
vendor/github.com/mattn/go-isatty/isatty_tcgets.go 查看文件

@@ -1,19 +0,0 @@
1
-// +build linux aix
2
-// +build !appengine
3
-// +build !android
4
-
5
-package isatty
6
-
7
-import "golang.org/x/sys/unix"
8
-
9
-// IsTerminal return true if the file descriptor is terminal.
10
-func IsTerminal(fd uintptr) bool {
11
-	_, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
12
-	return err == nil
13
-}
14
-
15
-// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
16
-// terminal. This is also always false on this environment.
17
-func IsCygwinTerminal(fd uintptr) bool {
18
-	return false
19
-}

+ 0
- 125
vendor/github.com/mattn/go-isatty/isatty_windows.go 查看文件

@@ -1,125 +0,0 @@
1
-// +build windows
2
-// +build !appengine
3
-
4
-package isatty
5
-
6
-import (
7
-	"errors"
8
-	"strings"
9
-	"syscall"
10
-	"unicode/utf16"
11
-	"unsafe"
12
-)
13
-
14
-const (
15
-	objectNameInfo uintptr = 1
16
-	fileNameInfo           = 2
17
-	fileTypePipe           = 3
18
-)
19
-
20
-var (
21
-	kernel32                         = syscall.NewLazyDLL("kernel32.dll")
22
-	ntdll                            = syscall.NewLazyDLL("ntdll.dll")
23
-	procGetConsoleMode               = kernel32.NewProc("GetConsoleMode")
24
-	procGetFileInformationByHandleEx = kernel32.NewProc("GetFileInformationByHandleEx")
25
-	procGetFileType                  = kernel32.NewProc("GetFileType")
26
-	procNtQueryObject                = ntdll.NewProc("NtQueryObject")
27
-)
28
-
29
-func init() {
30
-	// Check if GetFileInformationByHandleEx is available.
31
-	if procGetFileInformationByHandleEx.Find() != nil {
32
-		procGetFileInformationByHandleEx = nil
33
-	}
34
-}
35
-
36
-// IsTerminal return true if the file descriptor is terminal.
37
-func IsTerminal(fd uintptr) bool {
38
-	var st uint32
39
-	r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0)
40
-	return r != 0 && e == 0
41
-}
42
-
43
-// Check pipe name is used for cygwin/msys2 pty.
44
-// Cygwin/MSYS2 PTY has a name like:
45
-//   \{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master
46
-func isCygwinPipeName(name string) bool {
47
-	token := strings.Split(name, "-")
48
-	if len(token) < 5 {
49
-		return false
50
-	}
51
-
52
-	if token[0] != `\msys` &&
53
-		token[0] != `\cygwin` &&
54
-		token[0] != `\Device\NamedPipe\msys` &&
55
-		token[0] != `\Device\NamedPipe\cygwin` {
56
-		return false
57
-	}
58
-
59
-	if token[1] == "" {
60
-		return false
61
-	}
62
-
63
-	if !strings.HasPrefix(token[2], "pty") {
64
-		return false
65
-	}
66
-
67
-	if token[3] != `from` && token[3] != `to` {
68
-		return false
69
-	}
70
-
71
-	if token[4] != "master" {
72
-		return false
73
-	}
74
-
75
-	return true
76
-}
77
-
78
-// getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler
79
-// since GetFileInformationByHandleEx is not avilable under windows Vista and still some old fashion
80
-// guys are using Windows XP, this is a workaround for those guys, it will also work on system from
81
-// Windows vista to 10
82
-// see https://stackoverflow.com/a/18792477 for details
83
-func getFileNameByHandle(fd uintptr) (string, error) {
84
-	if procNtQueryObject == nil {
85
-		return "", errors.New("ntdll.dll: NtQueryObject not supported")
86
-	}
87
-
88
-	var buf [4 + syscall.MAX_PATH]uint16
89
-	var result int
90
-	r, _, e := syscall.Syscall6(procNtQueryObject.Addr(), 5,
91
-		fd, objectNameInfo, uintptr(unsafe.Pointer(&buf)), uintptr(2*len(buf)), uintptr(unsafe.Pointer(&result)), 0)
92
-	if r != 0 {
93
-		return "", e
94
-	}
95
-	return string(utf16.Decode(buf[4 : 4+buf[0]/2])), nil
96
-}
97
-
98
-// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2
99
-// terminal.
100
-func IsCygwinTerminal(fd uintptr) bool {
101
-	if procGetFileInformationByHandleEx == nil {
102
-		name, err := getFileNameByHandle(fd)
103
-		if err != nil {
104
-			return false
105
-		}
106
-		return isCygwinPipeName(name)
107
-	}
108
-
109
-	// Cygwin/msys's pty is a pipe.
110
-	ft, _, e := syscall.Syscall(procGetFileType.Addr(), 1, fd, 0, 0)
111
-	if ft != fileTypePipe || e != 0 {
112
-		return false
113
-	}
114
-
115
-	var buf [2 + syscall.MAX_PATH]uint16
116
-	r, _, e := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(),
117
-		4, fd, fileNameInfo, uintptr(unsafe.Pointer(&buf)),
118
-		uintptr(len(buf)*2), 0, 0)
119
-	if r == 0 || e != 0 {
120
-		return false
121
-	}
122
-
123
-	l := *(*uint32)(unsafe.Pointer(&buf))
124
-	return isCygwinPipeName(string(utf16.Decode(buf[2 : 2+l/2])))
125
-}

+ 0
- 1
vendor/github.com/mgutz/ansi/.gitignore 查看文件

@@ -1 +0,0 @@
1
-*.test

+ 0
- 9
vendor/github.com/mgutz/ansi/LICENSE 查看文件

@@ -1,9 +0,0 @@
1
-The MIT License (MIT)
2
-Copyright (c) 2013 Mario L. Gutierrez
3
-
4
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
-
6
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
-
8
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9
-

+ 0
- 121
vendor/github.com/mgutz/ansi/README.md 查看文件

@@ -1,121 +0,0 @@
1
-# ansi
2
-
3
-Package ansi is a small, fast library to create ANSI colored strings and codes.
4
-
5
-## Install
6
-
7
-Get it
8
-
9
-```sh
10
-go get -u github.com/mgutz/ansi
11
-```
12
-
13
-## Example
14
-
15
-```go
16
-import "github.com/mgutz/ansi"
17
-
18
-// colorize a string, SLOW
19
-msg := ansi.Color("foo", "red+b:white")
20
-
21
-// create a FAST closure function to avoid computation of ANSI code
22
-phosphorize := ansi.ColorFunc("green+h:black")
23
-msg = phosphorize("Bring back the 80s!")
24
-msg2 := phospohorize("Look, I'm a CRT!")
25
-
26
-// cache escape codes and build strings manually
27
-lime := ansi.ColorCode("green+h:black")
28
-reset := ansi.ColorCode("reset")
29
-
30
-fmt.Println(lime, "Bring back the 80s!", reset)
31
-```
32
-
33
-Other examples
34
-
35
-```go
36
-Color(s, "red")            // red
37
-Color(s, "red+b")          // red bold
38
-Color(s, "red+B")          // red blinking
39
-Color(s, "red+u")          // red underline
40
-Color(s, "red+bh")         // red bold bright
41
-Color(s, "red:white")      // red on white
42
-Color(s, "red+b:white+h")  // red bold on white bright
43
-Color(s, "red+B:white+h")  // red blink on white bright
44
-Color(s, "off")            // turn off ansi codes
45
-```
46
-
47
-To view color combinations, from project directory in terminal.
48
-
49
-```sh
50
-go test
51
-```
52
-
53
-## Style format
54
-
55
-```go
56
-"foregroundColor+attributes:backgroundColor+attributes"
57
-```
58
-
59
-Colors
60
-
61
-* black
62
-* red
63
-* green
64
-* yellow
65
-* blue
66
-* magenta
67
-* cyan
68
-* white
69
-* 0...255 (256 colors)
70
-
71
-Foreground Attributes
72
-
73
-* B = Blink
74
-* b = bold
75
-* h = high intensity (bright)
76
-* i = inverse
77
-* s = strikethrough
78
-* u = underline
79
-
80
-Background Attributes
81
-
82
-* h = high intensity (bright)
83
-
84
-## Constants
85
-
86
-* ansi.Reset
87
-* ansi.DefaultBG
88
-* ansi.DefaultFG
89
-* ansi.Black
90
-* ansi.Red
91
-* ansi.Green
92
-* ansi.Yellow
93
-* ansi.Blue
94
-* ansi.Magenta
95
-* ansi.Cyan
96
-* ansi.White
97
-* ansi.LightBlack
98
-* ansi.LightRed
99
-* ansi.LightGreen
100
-* ansi.LightYellow
101
-* ansi.LightBlue
102
-* ansi.LightMagenta
103
-* ansi.LightCyan
104
-* ansi.LightWhite
105
-
106
-## References
107
-
108
-Wikipedia ANSI escape codes [Colors](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors)
109
-
110
-General [tips and formatting](http://misc.flogisoft.com/bash/tip_colors_and_formatting)
111
-
112
-What about support on Windows? Use [colorable by mattn](https://github.com/mattn/go-colorable).
113
-Ansi and colorable are used by [logxi](https://github.com/mgutz/logxi) to support logging in
114
-color on Windows.
115
-
116
-## MIT License
117
-
118
-Copyright (c) 2013 Mario Gutierrez mario@mgutz.com
119
-
120
-See the file LICENSE for copying permission.
121
-

+ 0
- 285
vendor/github.com/mgutz/ansi/ansi.go 查看文件

@@ -1,285 +0,0 @@
1
-package ansi
2
-
3
-import (
4
-	"bytes"
5
-	"fmt"
6
-	"strconv"
7
-	"strings"
8
-)
9
-
10
-const (
11
-	black = iota
12
-	red
13
-	green
14
-	yellow
15
-	blue
16
-	magenta
17
-	cyan
18
-	white
19
-	defaultt = 9
20
-
21
-	normalIntensityFG = 30
22
-	highIntensityFG   = 90
23
-	normalIntensityBG = 40
24
-	highIntensityBG   = 100
25
-
26
-	start         = "\033["
27
-	bold          = "1;"
28
-	blink         = "5;"
29
-	underline     = "4;"
30
-	inverse       = "7;"
31
-	strikethrough = "9;"
32
-
33
-	// Reset is the ANSI reset escape sequence
34
-	Reset = "\033[0m"
35
-	// DefaultBG is the default background
36
-	DefaultBG = "\033[49m"
37
-	// DefaultFG is the default foreground
38
-	DefaultFG = "\033[39m"
39
-)
40
-
41
-// Black FG
42
-var Black string
43
-
44
-// Red FG
45
-var Red string
46
-
47
-// Green FG
48
-var Green string
49
-
50
-// Yellow FG
51
-var Yellow string
52
-
53
-// Blue FG
54
-var Blue string
55
-
56
-// Magenta FG
57
-var Magenta string
58
-
59
-// Cyan FG
60
-var Cyan string
61
-
62
-// White FG
63
-var White string
64
-
65
-// LightBlack FG
66
-var LightBlack string
67
-
68
-// LightRed FG
69
-var LightRed string
70
-
71
-// LightGreen FG
72
-var LightGreen string
73
-
74
-// LightYellow FG
75
-var LightYellow string
76
-
77
-// LightBlue FG
78
-var LightBlue string
79
-
80
-// LightMagenta FG
81
-var LightMagenta string
82
-
83
-// LightCyan FG
84
-var LightCyan string
85
-
86
-// LightWhite FG
87
-var LightWhite string
88
-
89
-var (
90
-	plain = false
91
-	// Colors maps common color names to their ANSI color code.
92
-	Colors = map[string]int{
93
-		"black":   black,
94
-		"red":     red,
95
-		"green":   green,
96
-		"yellow":  yellow,
97
-		"blue":    blue,
98
-		"magenta": magenta,
99
-		"cyan":    cyan,
100
-		"white":   white,
101
-		"default": defaultt,
102
-	}
103
-)
104
-
105
-func init() {
106
-	for i := 0; i < 256; i++ {
107
-		Colors[strconv.Itoa(i)] = i
108
-	}
109
-
110
-	Black = ColorCode("black")
111
-	Red = ColorCode("red")
112
-	Green = ColorCode("green")
113
-	Yellow = ColorCode("yellow")
114
-	Blue = ColorCode("blue")
115
-	Magenta = ColorCode("magenta")
116
-	Cyan = ColorCode("cyan")
117
-	White = ColorCode("white")
118
-	LightBlack = ColorCode("black+h")
119
-	LightRed = ColorCode("red+h")
120
-	LightGreen = ColorCode("green+h")
121
-	LightYellow = ColorCode("yellow+h")
122
-	LightBlue = ColorCode("blue+h")
123
-	LightMagenta = ColorCode("magenta+h")
124
-	LightCyan = ColorCode("cyan+h")
125
-	LightWhite = ColorCode("white+h")
126
-}
127
-
128
-// ColorCode returns the ANSI color color code for style.
129
-func ColorCode(style string) string {
130
-	return colorCode(style).String()
131
-}
132
-
133
-// Gets the ANSI color code for a style.
134
-func colorCode(style string) *bytes.Buffer {
135
-	buf := bytes.NewBufferString("")
136
-	if plain || style == "" {
137
-		return buf
138
-	}
139
-	if style == "reset" {
140
-		buf.WriteString(Reset)
141
-		return buf
142
-	} else if style == "off" {
143
-		return buf
144
-	}
145
-
146
-	foregroundBackground := strings.Split(style, ":")
147
-	foreground := strings.Split(foregroundBackground[0], "+")
148
-	fgKey := foreground[0]
149
-	fg := Colors[fgKey]
150
-	fgStyle := ""
151
-	if len(foreground) > 1 {
152
-		fgStyle = foreground[1]
153
-	}
154
-
155
-	bg, bgStyle := "", ""
156
-
157
-	if len(foregroundBackground) > 1 {
158
-		background := strings.Split(foregroundBackground[1], "+")
159
-		bg = background[0]
160
-		if len(background) > 1 {
161
-			bgStyle = background[1]
162
-		}
163
-	}
164
-
165
-	buf.WriteString(start)
166
-	base := normalIntensityFG
167
-	if len(fgStyle) > 0 {
168
-		if strings.Contains(fgStyle, "b") {
169
-			buf.WriteString(bold)
170
-		}
171
-		if strings.Contains(fgStyle, "B") {
172
-			buf.WriteString(blink)
173
-		}
174
-		if strings.Contains(fgStyle, "u") {
175
-			buf.WriteString(underline)
176
-		}
177
-		if strings.Contains(fgStyle, "i") {
178
-			buf.WriteString(inverse)
179
-		}
180
-		if strings.Contains(fgStyle, "s") {
181
-			buf.WriteString(strikethrough)
182
-		}
183
-		if strings.Contains(fgStyle, "h") {
184
-			base = highIntensityFG
185
-		}
186
-	}
187
-
188
-	// if 256-color
189
-	n, err := strconv.Atoi(fgKey)
190
-	if err == nil {
191
-		fmt.Fprintf(buf, "38;5;%d;", n)
192
-	} else {
193
-		fmt.Fprintf(buf, "%d;", base+fg)
194
-	}
195
-
196
-	base = normalIntensityBG
197
-	if len(bg) > 0 {
198
-		if strings.Contains(bgStyle, "h") {
199
-			base = highIntensityBG
200
-		}
201
-		// if 256-color
202
-		n, err := strconv.Atoi(bg)
203
-		if err == nil {
204
-			fmt.Fprintf(buf, "48;5;%d;", n)
205
-		} else {
206
-			fmt.Fprintf(buf, "%d;", base+Colors[bg])
207
-		}
208
-	}
209
-
210
-	// remove last ";"
211
-	buf.Truncate(buf.Len() - 1)
212
-	buf.WriteRune('m')
213
-	return buf
214
-}
215
-
216
-// Color colors a string based on the ANSI color code for style.
217
-func Color(s, style string) string {
218
-	if plain || len(style) < 1 {
219
-		return s
220
-	}
221
-	buf := colorCode(style)
222
-	buf.WriteString(s)
223
-	buf.WriteString(Reset)
224
-	return buf.String()
225
-}
226
-
227
-// ColorFunc creates a closure to avoid computation ANSI color code.
228
-func ColorFunc(style string) func(string) string {
229
-	if style == "" {
230
-		return func(s string) string {
231
-			return s
232
-		}
233
-	}
234
-	color := ColorCode(style)
235
-	return func(s string) string {
236
-		if plain || s == "" {
237
-			return s
238
-		}
239
-		buf := bytes.NewBufferString(color)
240
-		buf.WriteString(s)
241
-		buf.WriteString(Reset)
242
-		result := buf.String()
243
-		return result
244
-	}
245
-}
246
-
247
-// DisableColors disables ANSI color codes. The default is false (colors are on).
248
-func DisableColors(disable bool) {
249
-	plain = disable
250
-	if plain {
251
-		Black = ""
252
-		Red = ""
253
-		Green = ""
254
-		Yellow = ""
255
-		Blue = ""
256
-		Magenta = ""
257
-		Cyan = ""
258
-		White = ""
259
-		LightBlack = ""
260
-		LightRed = ""
261
-		LightGreen = ""
262
-		LightYellow = ""
263
-		LightBlue = ""
264
-		LightMagenta = ""
265
-		LightCyan = ""
266
-		LightWhite = ""
267
-	} else {
268
-		Black = ColorCode("black")
269
-		Red = ColorCode("red")
270
-		Green = ColorCode("green")
271
-		Yellow = ColorCode("yellow")
272
-		Blue = ColorCode("blue")
273
-		Magenta = ColorCode("magenta")
274
-		Cyan = ColorCode("cyan")
275
-		White = ColorCode("white")
276
-		LightBlack = ColorCode("black+h")
277
-		LightRed = ColorCode("red+h")
278
-		LightGreen = ColorCode("green+h")
279
-		LightYellow = ColorCode("yellow+h")
280
-		LightBlue = ColorCode("blue+h")
281
-		LightMagenta = ColorCode("magenta+h")
282
-		LightCyan = ColorCode("cyan+h")
283
-		LightWhite = ColorCode("white+h")
284
-	}
285
-}

+ 0
- 65
vendor/github.com/mgutz/ansi/doc.go 查看文件

@@ -1,65 +0,0 @@
1
-/*
2
-Package ansi is a small, fast library to create ANSI colored strings and codes.
3
-
4
-Installation
5
-
6
-    # this installs the color viewer and the package
7
-    go get -u github.com/mgutz/ansi/cmd/ansi-mgutz
8
-
9
-Example
10
-
11
-	// colorize a string, SLOW
12
-	msg := ansi.Color("foo", "red+b:white")
13
-
14
-	// create a closure to avoid recalculating ANSI code compilation
15
-	phosphorize := ansi.ColorFunc("green+h:black")
16
-	msg = phosphorize("Bring back the 80s!")
17
-	msg2 := phospohorize("Look, I'm a CRT!")
18
-
19
-	// cache escape codes and build strings manually
20
-	lime := ansi.ColorCode("green+h:black")
21
-	reset := ansi.ColorCode("reset")
22
-
23
-	fmt.Println(lime, "Bring back the 80s!", reset)
24
-
25
-Other examples
26
-
27
-	Color(s, "red")            // red
28
-	Color(s, "red+b")          // red bold
29
-	Color(s, "red+B")          // red blinking
30
-	Color(s, "red+u")          // red underline
31
-	Color(s, "red+bh")         // red bold bright
32
-	Color(s, "red:white")      // red on white
33
-	Color(s, "red+b:white+h")  // red bold on white bright
34
-	Color(s, "red+B:white+h")  // red blink on white bright
35
-
36
-To view color combinations, from terminal
37
-
38
-	ansi-mgutz
39
-
40
-Style format
41
-
42
-	"foregroundColor+attributes:backgroundColor+attributes"
43
-
44
-Colors
45
-
46
-	black
47
-	red
48
-	green
49
-	yellow
50
-	blue
51
-	magenta
52
-	cyan
53
-	white
54
-
55
-Attributes
56
-
57
-	b = bold foreground
58
-	B = Blink foreground
59
-	u = underline foreground
60
-	h = high intensity (bright) foreground, background
61
-	i = inverse
62
-
63
-Wikipedia ANSI escape codes [Colors](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors)
64
-*/
65
-package ansi

+ 0
- 57
vendor/github.com/mgutz/ansi/print.go 查看文件

@@ -1,57 +0,0 @@
1
-package ansi
2
-
3
-import (
4
-	"fmt"
5
-	"sort"
6
-
7
-	colorable "github.com/mattn/go-colorable"
8
-)
9
-
10
-// PrintStyles prints all style combinations to the terminal.
11
-func PrintStyles() {
12
-	// for compatibility with Windows, not needed for *nix
13
-	stdout := colorable.NewColorableStdout()
14
-
15
-	bgColors := []string{
16
-		"",
17
-		":black",
18
-		":red",
19
-		":green",
20
-		":yellow",
21
-		":blue",
22
-		":magenta",
23
-		":cyan",
24
-		":white",
25
-	}
26
-
27
-	keys := make([]string, 0, len(Colors))
28
-	for k := range Colors {
29
-		keys = append(keys, k)
30
-	}
31
-
32
-	sort.Sort(sort.StringSlice(keys))
33
-
34
-	for _, fg := range keys {
35
-		for _, bg := range bgColors {
36
-			fmt.Fprintln(stdout, padColor(fg, []string{"" + bg, "+b" + bg, "+bh" + bg, "+u" + bg}))
37
-			fmt.Fprintln(stdout, padColor(fg, []string{"+s" + bg, "+i" + bg}))
38
-			fmt.Fprintln(stdout, padColor(fg, []string{"+uh" + bg, "+B" + bg, "+Bb" + bg /* backgrounds */, "" + bg + "+h"}))
39
-			fmt.Fprintln(stdout, padColor(fg, []string{"+b" + bg + "+h", "+bh" + bg + "+h", "+u" + bg + "+h", "+uh" + bg + "+h"}))
40
-		}
41
-	}
42
-}
43
-
44
-func pad(s string, length int) string {
45
-	for len(s) < length {
46
-		s += " "
47
-	}
48
-	return s
49
-}
50
-
51
-func padColor(color string, styles []string) string {
52
-	buffer := ""
53
-	for _, style := range styles {
54
-		buffer += Color(pad(color+style, 20), color+style)
55
-	}
56
-	return buffer
57
-}

+ 0
- 9
vendor/modules.txt 查看文件

@@ -20,15 +20,6 @@ github.com/goshuirc/e-nfa
20 20
 github.com/goshuirc/irc-go/ircfmt
21 21
 github.com/goshuirc/irc-go/ircmatch
22 22
 github.com/goshuirc/irc-go/ircmsg
23
-# github.com/mattn/go-colorable v0.1.4
24
-## explicit
25
-github.com/mattn/go-colorable
26
-# github.com/mattn/go-isatty v0.0.10
27
-## explicit
28
-github.com/mattn/go-isatty
29
-# github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
30
-## explicit
31
-github.com/mgutz/ansi
32 23
 # github.com/onsi/ginkgo v1.12.0
33 24
 ## explicit
34 25
 # github.com/onsi/gomega v1.9.0

正在加载...
取消
保存