melbahja / got

Got: Simple golang package and CLI tool to download large files faster 🏃 than cURL and Wget!
MIT License
722 stars 46 forks source link

panic: slice bounds out of range #24

Closed issadarkthing closed 4 years ago

issadarkthing commented 4 years ago

Hi! I've tried to install got from the AUR and I received this error:

panic: runtime error: slice bounds out of range [:7] with length 4

goroutine 1 [running]:
main.main()
    /home/mohamed/work/dev/go/src/opensource/got/cmd/got/main.go:43 +0x583
melbahja commented 4 years ago

Did you have this error on the installation, or after running the got command ? Can you show me the output of go version and got -v

issadarkthing commented 4 years ago

I got the error when running got help. The output of go version:

go version go1.15.2 linux/amd64

got -v:

flag provided but not defined: -v
Got - the fast http downloader.

Usage:
  got --out path/file.zip http://example.com/file.zip

Version:
  0.1.5+fd202da

Author:
  Mohamed Elbahja <bm9qdW5r@gmail.com>

Flags:
  -concurrency uint
        Maximum chunks to download at the same time. (default 10)
  -out string
        Downloaded file destination.
  -size uint
        Maximum chunk size in bytes.
mpldr commented 4 years ago

This issue was caused by the protocol-parsing. It's fixed in the current version.

issadarkthing commented 4 years ago

I went to build using go get github.com/melbahja/got/cmd/got but the error is occuring. I had to clone the repo and build it myself. Now the error has been fixed.

mpldr commented 4 years ago

This may have been because to rebuild a binary that already was compiled you need to pass -u to go get this also updates the dependencies.