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

Function dirsToModuleRootAbs

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

Source from the content-addressed store, hash-verified

335}
336
337func dirsToModuleRootAbs(maindir, modroot string) []string {
338 var dirs = []string{maindir}
339 last := filepath.Join(maindir, "..")
340 // strip off path elements until we hit the module root
341 // adding `..`, `../..`, `../../..` until we're done
342 for maindir != modroot {
343 dirs = append(dirs, last)
344 last = filepath.Join(last, "..")
345 maindir = filepath.Dir(maindir)
346 }
347 return dirs
348}
349
350// validateOutputFormat checks if the output file extension matches the expected format
351func validateOutputFormat(outpath, expectedExt string) error {

Callers 1

buildAndRunFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected