MCPcopy Create free account
hub / github.com/apache/fory / resolve_go_module_root

Function resolve_go_module_root

compiler/fory_compiler/cli.py:430–438  ·  view source on GitHub ↗

Infer the Go module root for output layout.

(base_go_out: Path, schema: Schema)

Source from the content-addressed store, hash-verified

428
429
430def resolve_go_module_root(base_go_out: Path, schema: Schema) -> Path:
431 """Infer the Go module root for output layout."""
432 module_root = _find_go_module_root(base_go_out)
433 if module_root:
434 return module_root
435 _, package_name = go_package_info(schema)
436 if package_name and base_go_out.name == package_name:
437 return base_go_out.parent
438 return base_go_out
439
440
441def resolve_go_output_dir(base_go_out: Path, schema: Schema) -> Path:

Callers 1

compile_file_recursiveFunction · 0.85

Calls 2

_find_go_module_rootFunction · 0.85
go_package_infoFunction · 0.85

Tested by

no test coverage detected