Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add type safe ParseForm syntax #20

Open
crhntr opened this issue Dec 27, 2024 · 1 comment
Open

add type safe ParseForm syntax #20

crhntr opened this issue Dec 27, 2024 · 1 comment
Labels
enhancement New feature or request html-to-go

Comments

@crhntr
Copy link
Owner

crhntr commented Dec 27, 2024

{{define `ParseForm["net/url.".Values]`}}
<form method="PORT" action="/example">
  <textarea id="description"></textarea>
  <button type="submit">
</form>
{{end}}

{{define "GET / CreateExample(form)"}}
  {{- template `ParseForm["net/url.".Values]` -}}
{{end}}

note how package name is a string

The expected AST is:

  • ast.IndexExpr
    • Index: ast.SelectorExpr
      • X: ast.BasicLit
      • Sel: (the type's ident)
    • X: ast.Ident
      • Name: ParseForm
@crhntr crhntr added the enhancement New feature or request label Dec 27, 2024
@crhntr
Copy link
Owner Author

crhntr commented Feb 21, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request html-to-go
Projects
None yet
Development

No branches or pull requests

1 participant