d4l3k / wikigopher

Wikipedia DB Dump Server + wikitext parser in Go/Golang
13 stars 3 forks source link

templates.go:171: Error executing func "if": must have 2 or 3 arguments to #if, got 1 #2

Open prologic opened 5 years ago

prologic commented 5 years ago

Unsure how this bug is triggering; but posting here for visibility:

2019/01/14 00:50:08 main.go:122: read 18700000 entries
2019/01/14 00:50:08 main.go:122: read 18800000 entries
2019/01/14 00:50:08 main.go:128: Done reading!
2019/01/14 00:50:29 templates.go:171: Error executing func "if": must have 2 or 3 arguments to #if, got 1
main.glob..func2
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/templates.go:52
main.templateFuncHandler
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/templates.go:169
main.page.templateHandler
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/templates.go:200
main.page.templateHandler-fm
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:348
github.com/d4l3k/wikigopher/wikitext.(*current).ontemplate_preproc2
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:9037
github.com/d4l3k/wikigopher/wikitext.(*parser).callontemplate_preproc2
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:9056
github.com/d4l3k/wikigopher/wikitext.(*parser).parseActionExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12846
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12791
github.com/d4l3k/wikigopher/wikitext.(*parser).parseChoiceExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13005
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12801
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRule
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12757
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRuleRefExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13145
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12815
github.com/d4l3k/wikigopher/wikitext.(*parser).parseLabeledExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13023
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12803
github.com/d4l3k/wikigopher/wikitext.(*parser).parseSeqExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13158
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12817
github.com/d4l3k/wikigopher/wikitext.(*parser).parseActionExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12841
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12791
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRule
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12757
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRuleRefExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13145
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12815
github.com/d4l3k/wikigopher/wikitext.(*parser).parseLabeledExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13023
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12803
github.com/d4l3k/wikigopher/wikitext.(*parser).parseSeqExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13158
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12817
github.com/d4l3k/wikigopher/wikitext.(*parser).parseActionExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12841
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12791
github.com/d4l3k/wikigopher/wikitext.(*parser).parseChoiceExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13005
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12801
github.com/d4l3k/wikigopher/wikitext.(*parser).parseLabeledExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13023
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12803
2019/01/14 00:50:29 wikitext.go:312: inlinebreak false
2019/01/14 00:50:29 server.go:2979: http: panic serving [::1]:62500: runtime error: invalid memory address or nil pointer dereference
goroutine 5 [running]:
net/http.(*conn).serve.func1(0xc0000c8000)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1746 +0xd0
panic(0x163b4c0, 0x1c2da50)
    /usr/local/Cellar/go/1.11.4/libexec/src/runtime/panic.go:513 +0x1b9
html/template.(*Template).lookupAndEscapeTemplate(0x0, 0x16e9287, 0x4, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.11.4/libexec/src/html/template/template.go:144 +0x43
html/template.(*Template).ExecuteTemplate(0x0, 0x17981e0, 0xc000308000, 0x16e9287, 0x4, 0x1658e60, 0xc00e09e260, 0xc00e09e260, 0xc00e09e260)
    /usr/local/Cellar/go/1.11.4/libexec/src/html/template/template.go:133 +0x43
main.executeTemplate(0x17981e0, 0xc000308000, 0x16ef999, 0xc, 0x1658e60, 0xc00e09e260, 0xc000012500, 0x176e)
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:54 +0xa2
main.handleArticle(0x179c8a0, 0xc000308000, 0xc00012c200, 0x1000000013063af, 0x0)
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:353 +0x4f2
main.errorHandler.func1(0x179c8a0, 0xc000308000, 0xc00012c200)
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:298 +0x5e
net/http.HandlerFunc.ServeHTTP(0xc000138dd0, 0x179c8a0, 0xc000308000, 0xc00012c200)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1964 +0x44
net/http.(*ServeMux).ServeHTTP(0x1c64b80, 0x179c8a0, 0xc000308000, 0xc00012c200)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2361 +0x127
net/http.serverHandler.ServeHTTP(0xc00014b2b0, 0x179c8a0, 0xc000308000, 0xc00012c200)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2741 +0xab
net/http.(*conn).serve(0xc0000c8000, 0x179d1e0, 0xc0030d4a40)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1847 +0x646
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2851 +0x2f5
2019/01/14 00:50:29 templates.go:171: Error executing func "if": must have 2 or 3 arguments to #if, got 1
main.glob..func2
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/templates.go:52
main.templateFuncHandler
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/templates.go:169
main.page.templateHandler
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/templates.go:200
main.page.templateHandler-fm
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:348
github.com/d4l3k/wikigopher/wikitext.(*current).ontemplate_preproc2
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:9037
github.com/d4l3k/wikigopher/wikitext.(*parser).callontemplate_preproc2
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:9056
github.com/d4l3k/wikigopher/wikitext.(*parser).parseActionExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12846
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12791
github.com/d4l3k/wikigopher/wikitext.(*parser).parseChoiceExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13005
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12801
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRule
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12757
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRuleRefExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13145
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12815
github.com/d4l3k/wikigopher/wikitext.(*parser).parseLabeledExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13023
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12803
github.com/d4l3k/wikigopher/wikitext.(*parser).parseSeqExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13158
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12817
github.com/d4l3k/wikigopher/wikitext.(*parser).parseActionExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12841
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12791
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRule
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12757
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRuleRefExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13145
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12815
github.com/d4l3k/wikigopher/wikitext.(*parser).parseLabeledExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13023
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12803
github.com/d4l3k/wikigopher/wikitext.(*parser).parseSeqExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13158
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12817
github.com/d4l3k/wikigopher/wikitext.(*parser).parseActionExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12841
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12791
github.com/d4l3k/wikigopher/wikitext.(*parser).parseChoiceExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13005
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12801
github.com/d4l3k/wikigopher/wikitext.(*parser).parseLabeledExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13023
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12803
2019/01/14 00:50:29 wikitext.go:312: inlinebreak false
2019/01/14 00:50:29 server.go:2979: http: panic serving [::1]:62501: runtime error: invalid memory address or nil pointer dereference
goroutine 6 [running]:
net/http.(*conn).serve.func1(0xc0000c86e0)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1746 +0xd0
panic(0x163b4c0, 0x1c2da50)
    /usr/local/Cellar/go/1.11.4/libexec/src/runtime/panic.go:513 +0x1b9
html/template.(*Template).lookupAndEscapeTemplate(0x0, 0x16e9287, 0x4, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.11.4/libexec/src/html/template/template.go:144 +0x43
html/template.(*Template).ExecuteTemplate(0x0, 0x17981e0, 0xc00e0e0000, 0x16e9287, 0x4, 0x1658e60, 0xc007567540, 0xc007567540, 0xc007567540)
    /usr/local/Cellar/go/1.11.4/libexec/src/html/template/template.go:133 +0x43
main.executeTemplate(0x17981e0, 0xc00e0e0000, 0x16ef999, 0xc, 0x1658e60, 0xc007567540, 0xc043e85900, 0x176e)
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:54 +0xa2
main.handleArticle(0x179c8a0, 0xc00e0e0000, 0xc00012c100, 0x1000000013063af, 0x0)
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:353 +0x4f2
main.errorHandler.func1(0x179c8a0, 0xc00e0e0000, 0xc00012c100)
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:298 +0x5e
net/http.HandlerFunc.ServeHTTP(0xc000138dd0, 0x179c8a0, 0xc00e0e0000, 0xc00012c100)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1964 +0x44
net/http.(*ServeMux).ServeHTTP(0x1c64b80, 0x179c8a0, 0xc00e0e0000, 0xc00012c100)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2361 +0x127
net/http.serverHandler.ServeHTTP(0xc00014b2b0, 0x179c8a0, 0xc00e0e0000, 0xc00012c100)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2741 +0xab
net/http.(*conn).serve(0xc0000c86e0, 0x179d1e0, 0xc0030d4940)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1847 +0x646
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2851 +0x2f5
2019/01/14 00:50:29 templates.go:171: Error executing func "if": must have 2 or 3 arguments to #if, got 1
main.glob..func2
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/templates.go:52
main.templateFuncHandler
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/templates.go:169
main.page.templateHandler
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/templates.go:200
main.page.templateHandler-fm
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:348
github.com/d4l3k/wikigopher/wikitext.(*current).ontemplate_preproc2
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:9037
github.com/d4l3k/wikigopher/wikitext.(*parser).callontemplate_preproc2
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:9056
github.com/d4l3k/wikigopher/wikitext.(*parser).parseActionExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12846
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12791
github.com/d4l3k/wikigopher/wikitext.(*parser).parseChoiceExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13005
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12801
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRule
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12757
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRuleRefExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13145
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12815
github.com/d4l3k/wikigopher/wikitext.(*parser).parseLabeledExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13023
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12803
github.com/d4l3k/wikigopher/wikitext.(*parser).parseSeqExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13158
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12817
github.com/d4l3k/wikigopher/wikitext.(*parser).parseActionExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12841
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12791
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRule
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12757
github.com/d4l3k/wikigopher/wikitext.(*parser).parseRuleRefExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13145
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12815
github.com/d4l3k/wikigopher/wikitext.(*parser).parseLabeledExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13023
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12803
github.com/d4l3k/wikigopher/wikitext.(*parser).parseSeqExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13158
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12817
github.com/d4l3k/wikigopher/wikitext.(*parser).parseActionExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12841
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12791
github.com/d4l3k/wikigopher/wikitext.(*parser).parseChoiceExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13005
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12801
github.com/d4l3k/wikigopher/wikitext.(*parser).parseLabeledExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:13023
github.com/d4l3k/wikigopher/wikitext.(*parser).parseExpr
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/wikitext/wikitext.peg.go:12803
2019/01/14 00:50:29 wikitext.go:312: inlinebreak false
2019/01/14 00:50:29 server.go:2979: http: panic serving [::1]:62502: runtime error: invalid memory address or nil pointer dereference
goroutine 21 [running]:
net/http.(*conn).serve.func1(0xc00e5d8f00)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1746 +0xd0
panic(0x163b4c0, 0x1c2da50)
    /usr/local/Cellar/go/1.11.4/libexec/src/runtime/panic.go:513 +0x1b9
html/template.(*Template).lookupAndEscapeTemplate(0x0, 0x16e9287, 0x4, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.11.4/libexec/src/html/template/template.go:144 +0x43
html/template.(*Template).ExecuteTemplate(0x0, 0x17981e0, 0xc000309340, 0x16e9287, 0x4, 0x1658e60, 0xc07ff27700, 0xc07ff27700, 0xc07ff27700)
    /usr/local/Cellar/go/1.11.4/libexec/src/html/template/template.go:133 +0x43
main.executeTemplate(0x17981e0, 0xc000309340, 0x16ef999, 0xc, 0x1658e60, 0xc07ff27700, 0xc03e438500, 0x176e)
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:54 +0xa2
main.handleArticle(0x179c8a0, 0xc000309340, 0xc00e073c00, 0x1000000013063af, 0x0)
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:353 +0x4f2
main.errorHandler.func1(0x179c8a0, 0xc000309340, 0xc00e073c00)
    /Users/prologic/go/src/github.com/d4l3k/wikigopher/main.go:298 +0x5e
net/http.HandlerFunc.ServeHTTP(0xc000138dd0, 0x179c8a0, 0xc000309340, 0xc00e073c00)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1964 +0x44
net/http.(*ServeMux).ServeHTTP(0x1c64b80, 0x179c8a0, 0xc000309340, 0xc00e073c00)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2361 +0x127
net/http.serverHandler.ServeHTTP(0xc00014b2b0, 0x179c8a0, 0xc000309340, 0xc00e073c00)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2741 +0xab
net/http.(*conn).serve(0xc00e5d8f00, 0x179d1e0, 0xc00e05ecc0)
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1847 +0x646
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2851 +0x2f5
^C^L
prologic commented 5 years ago

Added some extra logging and I see attrs has this:

2019/01/14 01:02:17 templates.go:171: Error executing func "if": must have 2 or 3 arguments to #if, got 1: [{{ template error: unknown template: "Wikipedia:Main_Page/Tomorrow", args: [] }}]
prologic commented 5 years ago

Ahh! This won't run outside of the source directory?

At least now I get a nice 404 :)

screen shot 2019-01-14 at 1 05 50 am
d4l3k commented 5 years ago

Have you tried using other pages? The homepage of Wikipedia is sort of a pathological case for wikigopher since it's heavily template based. This project doesn't implement all of the template language and there's probably some large gaps/bugs in it.

I'd be happy to accept pull requests to get it working though :smiley:

Most pages should work just fine.

prologic commented 5 years ago

Okay thanks for the heads up ! I’ll try to skip those pesky front pages 😁

On Mon, 14 Jan 2019 at 12:11, Tristan Rice notifications@github.com wrote:

Have you tried using other pages? The homepage of Wikipedia is sort of a pathological case for wikigopher since it's heavily template based. This project doesn't implement all of the template language and there's probably some large gaps/bugs in it.

I'd be happy to accept pull requests to get it working though 😃

Most pages should work just fine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/d4l3k/wikigopher/issues/2#issuecomment-453887660, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOv-lPeLhTvI3WN05LrxL0fl4jnoRN6ks5vC-c5gaJpZM4Z9Nas .

--

James Mills / prologic

E: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au