snwfdhmp/errlog

"panic: runtime error: slice bounds out of range" in "github.com/snwfdhmp/errlog.getStackTrace"

Closed this issue · 1 comments

STR

  1. Create a new folder and move into it.
  2. Create "main.go" and copy the example code into it.
  3. Open a terminal/CMD window in the folder.
  4. Run "go mod init test"
  5. Run "go run main.go"

Result

go: finding github.com/spf13/afero v1.2.1
go: finding github.com/mattn/go-colorable v0.1.1
go: finding github.com/fatih/color v1.7.0
go: finding github.com/snwfdhmp/errlog v0.0.0-20190221162002-4ce12f64f172
go: finding github.com/mattn/go-isatty v0.0.5
go: finding golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223
go: downloading github.com/snwfdhmp/errlog v0.0.0-20190221162002-4ce12f64f172
go: downloading github.com/fatih/color v1.7.0
go: downloading github.com/sirupsen/logrus v1.3.0
go: downloading github.com/spf13/afero v1.2.1
go: downloading github.com/mattn/go-colorable v0.1.1
go: downloading github.com/mattn/go-isatty v0.0.5
go: downloading golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
go: downloading golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223
Start of the program
I do things !
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
github.com/snwfdhmp/errlog.getStackTrace(0x2, 0xc000121e00, 0x4ac187, 0x8)
        /home/user/go/pkg/mod/github.com/snwfdhmp/errlog@v0.0.0-20190221162002-4ce12f64f172/regexp.go:35 +0xd5
github.com/snwfdhmp/errlog.(*logger).Debug(0x89fd10, 0x6f5000, 0xc00008ce10, 0xc00008ce10)
        /home/user/go/pkg/mod/github.com/snwfdhmp/errlog@v0.0.0-20190221162002-4ce12f64f172/logger.go:82 +0x5e
github.com/snwfdhmp/errlog.Debug(0x6f5000, 0xc00008ce10, 0x15)
        /home/user/go/pkg/mod/github.com/snwfdhmp/errlog@v0.0.0-20190221162002-4ce12f64f172/errlog.go:89 +0x4c
main.someBigFunction()
        /mnt/dataDrive/err/main.go:25 +0x6b
main.wrapingFunc()
        /mnt/dataDrive/err/main.go:19 +0x20
main.main()
        /mnt/dataDrive/err/main.go:13 +0x66
exit status 2

@GithubUser5462 Thank you for your report !

It's fixed now :)