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

template: layout:6: missing value for block clause #121

Open
qiuzhongrun opened this issue Mar 21, 2017 · 6 comments
Open

template: layout:6: missing value for block clause #121

qiuzhongrun opened this issue Mar 21, 2017 · 6 comments
Labels

Comments

@qiuzhongrun
Copy link

I am sorry to bother you my friend. But I can run episode 5.
Maybe I missed something.

➜ episode5 git:(master) ✗ ./episode5
panic: template: layout:6: missing value for block clause

goroutine 1 [running]:
panic(0x38cfc0, 0xc42000d710)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
html/template.Must(0x0, 0x59ff60, 0xc42000d710, 0x0)
/usr/local/go/src/html/template/template.go:340 +0x66
github.com/unrolled/render.(*Render).compileTemplatesFromDir.func1(0xc4200c8c80, 0x15, 0x5a7020, 0xc42013c000, 0x0, 0x0, 0x0, 0x0)
/Users/go2run/code/go/src/github.com/unrolled/render/render.go:196 +0x39e
path/filepath.walk(0xc4200c8c80, 0x15, 0x5a7020, 0xc42013c000, 0xc4200c8a80, 0x0, 0x0)
/usr/local/go/src/path/filepath/path.go:351 +0x81
path/filepath.walk(0x3fd8dc, 0x9, 0x5a7020, 0xc420071930, 0xc4200c8a80, 0x0, 0x1)
/usr/local/go/src/path/filepath/path.go:376 +0x344
path/filepath.Walk(0x3fd8dc, 0x9, 0xc4200c8a80, 0xc42004d9b8, 0xc420019500)
/usr/local/go/src/path/filepath/path.go:398 +0xd5
github.com/unrolled/render.(*Render).compileTemplatesFromDir(0xc42000a800)
/Users/go2run/code/go/src/github.com/unrolled/render/render.go:201 +0x300
github.com/unrolled/render.(*Render).compileTemplates(0xc42000a800)
/Users/go2run/code/go/src/github.com/unrolled/render/render.go:149 +0x3d
github.com/unrolled/render.New(0xc42004dd40, 0x1, 0x1, 0x0)
/Users/go2run/code/go/src/github.com/unrolled/render/render.go:124 +0x1f0
github.com/arschles/go-in-5-minutes/episode5/handlers.NewRenderRenderer(0x3fd8dc, 0x9, 0xc42000d580, 0x1, 0x1, 0x5c46a8, 0x1, 0x1, 0x1, 0xc42001a0b8)
/Users/go2run/code/go/src/github.com/arschles/go-in-5-minutes/episode5/handlers/renderer.go:36 +0x130
main.main()
/Users/go2run/code/go/src/github.com/arschles/go-in-5-minutes/episode5/main.go:31 +0x1b1

layout.html line 6 is
{{block "css"}}

thomasdarimont added a commit to thomasdarimont/go-in-5-minutes that referenced this issue May 30, 2017
It seems that the block template syntax changed
during go versions.

This works with the current go version 1.8.1.
arschles pushed a commit that referenced this issue Dec 27, 2017
It seems that the block template syntax changed
during go versions.

This works with the current go version 1.8.1.
@arschles
Copy link
Owner

Hey @go2run - thanks for the bug report. I'll look into this as soon as I can.

@arschles arschles added the bug label Jan 15, 2018
@arschles
Copy link
Owner

... and I'll update here with a fix!

@kdosburn
Copy link

Hi! Has there been a fix? I'm having this same issue :)

@arschles
Copy link
Owner

@kdosburn nope, I totally forgot about this! Thanks for reminding me - I'll do a fix this weekend

@arschles
Copy link
Owner

Hi @kdosburn and @go2run so sorry for the delay!

I wasn't able to reproduce the issue. A few questions to help me out:

  1. Did you execute ./episode5 from inside the episode5 directory?
  2. Does this panic only happen for a specific path?

@arschles
Copy link
Owner

Also, I just checked in #161. It adds the vendor directory for episode 5, so try that out on the off chance that a dependency affects this problem (I don't expect that it would)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants