Infer the Go module root for output layout.
(base_go_out: Path, schema: Schema)
| 428 | |
| 429 | |
| 430 | def 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 | |
| 441 | def resolve_go_output_dir(base_go_out: Path, schema: Schema) -> Path: |
no test coverage detected