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

Method append_packages

package.go:228–242  ·  view source on GitHub ↗

Function fills 'ps' set with packages from 'packages' import information. In case if package is not in the cache, it creates one and adds one to the cache.

(ps map[string]*package_file_cache, pkgs []package_import)

Source from the content-addressed store, hash-verified

226// Function fills 'ps' set with packages from 'packages' import information.
227// In case if package is not in the cache, it creates one and adds one to the cache.
228func (c package_cache) append_packages(ps map[string]*package_file_cache, pkgs []package_import) {
229 for _, m := range pkgs {
230 if _, ok := ps[m.abspath]; ok {
231 continue
232 }
233
234 if mod, ok := c[m.abspath]; ok {
235 ps[m.abspath] = mod
236 } else {
237 mod = new_package_file_cache(m.abspath, m.path)
238 ps[m.abspath] = mod
239 c[m.abspath] = mod
240 }
241 }
242}
243
244var g_builtin_unsafe_package = []byte(`
245import

Callers 1

update_cachesMethod · 0.80

Calls 1

new_package_file_cacheFunction · 0.85

Tested by

no test coverage detected