aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2020-04-05 01:20:50 -0500
committerGitHub <noreply@github.com>2020-04-05 07:20:50 +0100
commitbaadb51445b1d990f72a37b0ef7575f5ed72824a (patch)
tree192fa25f2dc144bfa5c78adafc9ccd8f92db86bb /vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go
parentb74d30ae275b4f025f689efca748dd0cbd826b22 (diff)
downloadgitea-baadb51445b1d990f72a37b0ef7575f5ed72824a.tar.gz
gitea-baadb51445b1d990f72a37b0ef7575f5ed72824a.zip
Add gitea-vet (#10948)
* Add copyright Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add gitea-vet and fix non-compliance Signed-off-by: jolheiser <john.olheiser@gmail.com> * Combine tools.go into build.go and clean up Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove extra GO111MODULE=on Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go')
-rw-r--r--vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go
index ce38fdcf83..5901a8f616 100644
--- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go
+++ b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go
@@ -76,8 +76,9 @@ func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) e
}
func parseDirEnt(buf []byte) (consumed int, name string, typ os.FileMode) {
- // golang.org/issue/15653
- dirent := (*syscall.Dirent)(unsafe.Pointer(&buf[0]))
+ // golang.org/issue/37269
+ dirent := &syscall.Dirent{}
+ copy((*[unsafe.Sizeof(syscall.Dirent{})]byte)(unsafe.Pointer(dirent))[:], buf)
if v := unsafe.Offsetof(dirent.Reclen) + unsafe.Sizeof(dirent.Reclen); uintptr(len(buf)) < v {
panic(fmt.Sprintf("buf size of %d smaller than dirent header size %d", len(buf), v))
}