]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/imports: resolve symlinks in ScanDir
authorBryan C. Mills <bcmills@google.com>
Wed, 10 Oct 2018 14:03:27 +0000 (10:03 -0400)
committerBryan C. Mills <bcmills@google.com>
Tue, 27 Nov 2018 06:27:52 +0000 (06:27 +0000)
commit440368da526b69fe9a500e29ce9cd84aa7cc6c35
treeb418eb98cbf3fcedeba8f56458a3e7359500e91e
parent979d9027aecf265214a6dcc27fe037bfd70355f2
cmd/go/internal/imports: resolve symlinks in ScanDir

We were using the mode reported by ReadDir to decide whether each
entry is a file, but in the case of symlinks that isn't sufficient: a
symlink could point to either a file or a directory, and if it is a
file we should treat it as such.

Fixes #28107

Change-Id: Icf6e495dce427a7b1124c9cc9f085e40a215c169
Reviewed-on: https://go-review.googlesource.com/c/141097
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/internal/imports/scan.go
src/cmd/go/testdata/script/mod_symlink.txt [new file with mode: 0644]