From d571deef57b682f92e71f9374c2c59893db811af Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Sat, 17 Aug 2019 00:48:08 +0200 Subject: vendor: upgrade github.com/99designs/gqlgen to v0.9.2 --- vendor/github.com/99designs/gqlgen/internal/code/imports.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/99designs/gqlgen/internal/code/imports.go') diff --git a/vendor/github.com/99designs/gqlgen/internal/code/imports.go b/vendor/github.com/99designs/gqlgen/internal/code/imports.go index 75c30fe1..ad62f7c5 100644 --- a/vendor/github.com/99designs/gqlgen/internal/code/imports.go +++ b/vendor/github.com/99designs/gqlgen/internal/code/imports.go @@ -62,22 +62,23 @@ func ImportPathForDir(dir string) (res string) { modDir := dir assumedPart := "" for { - f, err := ioutil.ReadFile(filepath.Join(modDir, "/", "go.mod")) + f, err := ioutil.ReadFile(filepath.Join(modDir, "go.mod")) if err == nil { // found it, stop searching return string(modregex.FindSubmatch(f)[1]) + assumedPart } assumedPart = "/" + filepath.Base(modDir) + assumedPart - modDir, err = filepath.Abs(filepath.Join(modDir, "..")) + parentDir, err := filepath.Abs(filepath.Join(modDir, "..")) if err != nil { panic(err) } - // Walked all the way to the root and didnt find anything :'( - if modDir == "/" { + if parentDir == modDir { + // Walked all the way to the root and didnt find anything :'( break } + modDir = parentDir } for _, gopath := range gopaths { -- cgit