Return (import_path, package_name) for Go.
(schema: Schema)
| 195 | |
| 196 | |
| 197 | def 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 | |
| 212 | def collect_schema_graph( |
no test coverage detected