We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've studied #8 then tried to run go run main.go, and got nothing printed , could you help me what's wrong with it, thank you!
go run main.go
//main.go package main import ( "github.com/flosch/pongo2" ) func main() { ctx := map[string]interface{}{ "Test": Test{Name: "My Test"}, } tpl, _ := pongo2.FromString("{{ Test.ShowName() }}") //{{ Test.ShowName }} printed nothing also. out, _ := tpl.Execute(ctx) println(out) } type Test struct { Name string } func (t *Test) ShowName() *pongo2.Value { return pongo2.AsValue("ShowName") }
The text was updated successfully, but these errors were encountered:
Have you checked the errors? Just return a string and try return "ShowName"
return "ShowName"
Sorry, something went wrong.
No branches or pull requests
I've studied #8 then tried to run
go run main.go
, and got nothing printed , could you help me what's wrong with it, thank you!The text was updated successfully, but these errors were encountered: