Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

対象ディレクトリがシンボリックリンクだとエラー #4

Closed
thinca opened this issue Sep 28, 2015 · 5 comments
Closed

Comments

@thinca
Copy link

thinca commented Sep 28, 2015

$ files path/to/symbolic-link-dir
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.func·006(0xc20801e100, 0x1d)
        /home/thinca/.go/src/github.com/mattn/files/files.go:194 +0x119
main.main()
        /home/thinca/.go/src/github.com/mattn/files/files.go:209 +0x933

仕様かもしれませんが報告しておきます。

mattn added a commit that referenced this issue Sep 28, 2015
mattn added a commit that referenced this issue Sep 28, 2015
@mattn
Copy link
Owner

mattn commented Sep 28, 2015

直したつもりですが、どうでしょうか。

@thinca
Copy link
Author

thinca commented Sep 28, 2015

エラーが微妙に変わりました。

panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.main.func1.2(0xc82007e4fe, 0xb)
        /home/thinca/.go/src/github.com/mattn/files/files.go:200 +0x135
main.main()
        /home/thinca/.go/src/github.com/mattn/files/files.go:215 +0x9d2

goroutine 19 [runnable]:
syscall.Syscall6(0x101, 0xffffffffffffff9c, 0xc8200d2000, 0x80000, 0x0, 0x0, 0x0, 0x3, 0x80000, 0x0)
        /usr/lib/go/src/syscall/asm_linux_amd64.s:44 +0x5
syscall.openat(0xffffffffffffff9c, 0xc82007eb40, 0x29, 0x80000, 0x0, 0x0, 0x0, 0x0)
        /usr/lib/go/src/syscall/zsyscall_linux_amd64.go:40 +0xc8
syscall.Open(0xc82007eb40, 0x29, 0x80000, 0x0, 0x402733, 0x0, 0x0)
        /usr/lib/go/src/syscall/syscall_linux.go:51 +0x58
os.OpenFile(0xc82007eb40, 0x29, 0x0, 0xc800000000, 0xc8200d0000, 0x0, 0x0)
        /usr/lib/go/src/os/file_unix.go:93 +0xa3
os.Open(0xc82007eb40, 0x29, 0x7f491f569e28, 0x0, 0x0)
        /usr/lib/go/src/os/file.go:246 +0x48
path/filepath.readDirNames(0xc82007eb40, 0x29, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:402 +0x5b
path/filepath.walk(0xc82007eb40, 0x29, 0x7f491f37d390, 0xc8200d0000, 0xc820046f58, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:361 +0x1a2
path/filepath.walk(0xc820074120, 0x1e, 0x7f491f37d390, 0xc820092140, 0xc820046f58, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:374 +0x4fc
path/filepath.Walk(0xc820074120, 0x1e, 0xc820046f58, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:396 +0xe1
main.filesSync.func1(0xc820074120, 0x1e, 0x7f491f379000, 0xc82007a7e0, 0xc820078120)
        /home/thinca/.go/src/github.com/mattn/files/files.go:41 +0x9f
created by main.filesSync
        /home/thinca/.go/src/github.com/mattn/files/files.go:77 +0x11e

@mattn
Copy link
Owner

mattn commented Sep 28, 2015

あー、わかりました。直します。

mattn added a commit that referenced this issue Sep 28, 2015
mattn added a commit that referenced this issue Sep 28, 2015
@mattn
Copy link
Owner

mattn commented Sep 28, 2015

どうでしょうか?

@thinca
Copy link
Author

thinca commented Sep 28, 2015

動きました!ありがとうございます!

@thinca thinca closed this as completed Sep 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants