Function transpile
Source pub fn transpile(
source: &str,
target: &str,
code: &str,
) -> Result<String, TranspileError>
1fn main() -> Result<(), Box<dyn std::error::Error>> {
2 let go = r#"package main
3func add(a int, b int) int {
4 return a + b
5}
6"#;
7 println!("{}", code_transpiler::transpile("go", "rust", go)?);
8 Ok(())
9}