-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
feat: add arbitrary go code support #713
Conversation
I've made a first pass at the experiment functionality. Next I'll look at documentation. I do think that package level vars are the best way to do this without affecting the rest of the code massively, or causing a performance impact. Let me know what you think, happy to change, this approach was made basically copying and simplifying the GOEXPERIMENT code. |
I tried to add a generator test, but realised that the generator test couldn't run without the experiment being enabled, which complicated execution of the CI/CD processes, so best leave it for now. I renamed But I noticed the formatting of package testfor
templ render(items []string) {
{{ a := "a" }}
<div>{ a }</div>
{{b := func() string {
return "b"
}
}}
<div>{ b() }</div>
{{
c := func() (string, error) {
return "c", nil
}
}}
<div>{ c() }</div>
} Looks great! |
Good shout on those amends! Maybe worth us adding an experiment field to the editor plugins that allow for config so things like this can easily be enabled on the LSP. |
This is really awesome! I am already using it to generate random strings as ids in components. I dont have to pass them now as function parameters. |
Closes #109
TODO: