GitJournal / GitJournal/git-auto-sync

Arch Linux - git-auto-sync check causes panic: runtime error: slice bounds out of range

Open
#24 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
201
Forks
20
PR merge metrics
No merged PRs in 30d

Description

I managed to get it running on Arch Linux (CachyOS).

The sync command actually worked out-of-the-box, but I wasted quite some time first because the "check" command caused a panic:

```
panic: runtime error: slice bounds out of range [18:17]

goroutine 1 [running]:
github.com/GitJournal/git-auto-sync/common.ShouldIgnoreFile({0xc0000241e4, 0x11}, {0xc0000249f0?, 0xc00007fac0?})
/home/narve/misc-packages/git-auto-sync/common/ignore.go:30 +0x35b
main.main.func3(0xc00007fac0)
/home/narve/misc-packages/git-auto-sync/main.go:105 +0xda
github.com/urfave/cli/v2.(*Command).Run(0xc0000ead80, 0xc00007f9c0)
/home/narve/go/pkg/mod/github.com/urfave/cli/v2@v2.5.1/command.go:163 +0x565
github.com/urfave/cli/v2.(*App).RunContext(0xc0000af1e0, {0xac2208, 0xebdca0}, {0xc000020080, 0x2, 0x2})
/home/narve/go/pkg/mod/github.com/urfave/cli/v2@v2.5.1/app.go:313 +0xabb
github.com/urfave/cli/v2.(*App).Run(...)
/home/narve/go/pkg/mod/github.com/urfave/cli/v2@v2.5.1/app.go:224
main.main()
/home/narve/misc-packages/git-auto-sync/main.go:159 +0x876

```

I didn't understand why there was a +1, (and I've never programmed in Go...), so I removed +1 and then it doesn't panic anymore.
The sync command itself seems to work.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.