alef 0.60.0

Opinionated polyglot binding generator for Rust libraries
Documentation
package main{{ "\n\n" }}import (
{% for import in imports %}
  {{- "\t" }}{% if import.alias %}{{ import.alias }} {% endif %}"{{ import.path }}"
{% endfor %}
)

{% for declaration in package_decls %}
{{ declaration }}
{% endfor %}
func main() {
{% for line in setup_lines %}
  {{- "\t" }}{{ line }}
{% endfor %}
{% if client_setup %}
  {{- "\t" }}{{ client_setup }}
{% endif %}
{% if returns_void %}
  {{- "\t" }}err := {{ call_expr }}
{% elif returns_error %}
  {{- "\t" }}{{ result_var }}, err := {{ call_expr }}
{% else %}
  {{- "\t" }}{{ result_var }} := {{ call_expr }}
{% endif %}
{% if returns_error or returns_void %}
  {{- "\tif err != nil {\n\t\tpanic(err)\n\t}" }}
{% endif %}
{% if not returns_void %}
  {{- "\t" }}fmt.Println({{ result_var }})
{% endif %}
}