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

Function go_package_info

compiler/fory_compiler/cli.py:197–209  ·  view source on GitHub ↗

Return (import_path, package_name) for Go.

(schema: Schema)

Source from the content-addressed store, hash-verified

195
196
197def go_package_info(schema: Schema) -> Tuple[Optional[str], str]:
198 """Return (import_path, package_name) for Go."""
199 go_package = schema.get_option("go_package")
200 if go_package:
201 if ";" in go_package:
202 import_path, package_name = go_package.split(";", 1)
203 return import_path, package_name
204 import_path = go_package
205 package_name = import_path.rstrip("/").split("/")[-1]
206 return import_path, package_name
207 if schema.package:
208 return None, schema.package.split(".")[-1]
209 return None, ""
210
211
212def collect_schema_graph(

Callers 2

resolve_go_module_rootFunction · 0.85
resolve_go_output_dirFunction · 0.85

Calls 1

get_optionMethod · 0.80

Tested by

no test coverage detected