X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fcoc-go-data%2Ftools%2Fpkg%2Fmod%2Fgolang.org%2Fx%2Ftools%40v0.0.0-20201105173854-bc9fc8d8c4bc%2Finternal%2Flsp%2Fcache%2Fos_darwin.go;fp=.config%2Fcoc%2Fextensions%2Fcoc-go-data%2Ftools%2Fpkg%2Fmod%2Fgolang.org%2Fx%2Ftools%40v0.0.0-20201105173854-bc9fc8d8c4bc%2Finternal%2Flsp%2Fcache%2Fos_darwin.go;h=0000000000000000000000000000000000000000;hp=73c26fd4294a32aa3b140ca870cef88c9aaf2025;hb=3ddadb3c98564791f0ac36cb39771d844a63dc91;hpb=5f797af6612ed10887189b47a1efc2f915586e59 diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/internal/lsp/cache/os_darwin.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/internal/lsp/cache/os_darwin.go deleted file mode 100644 index 73c26fd4..00000000 --- a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/internal/lsp/cache/os_darwin.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cache - -import ( - "bytes" - "fmt" - "os" - "path/filepath" - "strings" - "syscall" - "unsafe" -) - -func init() { - checkPathCase = darwinCheckPathCase -} - -func darwinCheckPathCase(path string) error { - // Darwin provides fcntl(F_GETPATH) to get a path for an arbitrary FD. - // Conveniently for our purposes, it gives the canonical case back. But - // there's no guarantee that it will follow the same route through the - // filesystem that the original path did. - - path, err := filepath.Abs(path) - if err != nil { - return err - } - fd, err := syscall.Open(path, os.O_RDONLY, 0) - if err != nil { - return err - } - defer syscall.Close(fd) - buf := make([]byte, 4096) // No MAXPATHLEN in syscall, I think it's 1024, this is bigger. - - // Wheeee! syscall doesn't expose a way to call Fcntl except FcntlFlock. - // As of writing, it just passes the pointer through, so we can just lie. - if err := syscall.FcntlFlock(uintptr(fd), syscall.F_GETPATH, (*syscall.Flock_t)(unsafe.Pointer(&buf[0]))); err != nil { - return err - } - buf = buf[:bytes.IndexByte(buf, 0)] - - isRoot := func(p string) bool { - return p[len(p)-1] == filepath.Separator - } - // Darwin seems to like having multiple names for the same folder. Match as much of the suffix as we can. - for got, want := path, string(buf); !isRoot(got) && !isRoot(want); got, want = filepath.Dir(got), filepath.Dir(want) { - g, w := filepath.Base(got), filepath.Base(want) - if !strings.EqualFold(g, w) { - break - } - if g != w { - return fmt.Errorf("case mismatch in path %q: component %q should be %q", path, g, w) - } - } - return nil -}