MCPcopy Create free account
hub / github.com/nsf/gocode / abs_path_for_package

Function abs_path_for_package

declcache.go:152–165  ·  view source on GitHub ↗
(filename, p string, context *package_lookup_context)

Source from the content-addressed store, hash-verified

150}
151
152func abs_path_for_package(filename, p string, context *package_lookup_context) (string, bool) {
153 dir, _ := filepath.Split(filename)
154 if len(p) == 0 {
155 return "", false
156 }
157 if p[0] == '.' {
158 return fmt.Sprintf("%s.a", filepath.Join(dir, p)), true
159 }
160 pkg, ok := find_go_dag_package(p, dir)
161 if ok {
162 return pkg, true
163 }
164 return find_global_file(p, context)
165}
166
167func path_and_alias(imp *ast.ImportSpec) (string, string) {
168 path := ""

Callers 2

resolveKnownPackageIdentFunction · 0.85
collect_package_importsFunction · 0.85

Calls 2

find_go_dag_packageFunction · 0.85
find_global_fileFunction · 0.85

Tested by

no test coverage detected