code: func goModPath(fname string, isDir bool) (string, error) {
  	root := fname
  	if !isDir {
  		root = filepath.Dir(fname)
  	}
  
  	goModPathCache.RLock()
  	goModPath, ok := goModPathCache.paths[root]
  	goModPathCache.RUnlock()
  	if ok {
  		return goModPath, nil
  	}
  
  	defer func() {
  		goModPathCache.Lock()
  		goModPathCache.paths[root] = goModPath
  		goModPathCache.Unlock()
  	}()
  
  	cmd := exec.Command("go", "env", "GOMOD")
  	cmd.Dir = root
  
  	stdout, err := cmd.Output()
  	if err != nil {
  		return "", err
  	}
  
  	goModPath = string(bytes.TrimSpace(stdout))
  
  	return goModPath, nil
  }
docs: // empty if no go.mod, GO111MODULE=off or go without go modules support