MCPcopy
hub / github.com/tinygo-org/tinygo / dirsToModuleRootRel

Function dirsToModuleRootRel

main.go:323–335  ·  view source on GitHub ↗
(maindir, modroot string)

Source from the content-addressed store, hash-verified

321}
322
323func dirsToModuleRootRel(maindir, modroot string) []string {
324 var dirs []string
325 last := ".."
326 // strip off path elements until we hit the module root
327 // adding `..`, `../..`, `../../..` until we're done
328 for maindir != modroot {
329 dirs = append(dirs, last)
330 last = filepath.Join(last, "..")
331 maindir = filepath.Dir(maindir)
332 }
333 dirs = append(dirs, ".")
334 return dirs
335}
336
337func dirsToModuleRootAbs(maindir, modroot string) []string {
338 var dirs = []string{maindir}

Callers 1

buildAndRunFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected