agonzalezro / polo

Static site generator written in Go and "compatible" with Jekyll & Pelican content
MIT License
47 stars 9 forks source link

Polo doesn't validate json config files. #37

Closed ipedrazas closed 9 years ago

ipedrazas commented 9 years ago

This is what happens if you download the linux binary and run polo using the config.json from the examples

-> % polo . ../ipedrazas.github.io
2015/11/01 18:19:12 invalid character '}' looking for beginning of object key string
panic: invalid character '}' looking for beginning of object key string

goroutine 1 [running]:
log.Panic(0xc208099f00, 0x1, 0x1)
    /usr/src/go/src/log/log.go:307 +0xb9
main.main()
    /app/src/cmd/polo/polo.go:85 +0x560

goroutine 2 [runnable]:
runtime.forcegchelper()
    /usr/src/go/src/runtime/proc.go:90
runtime.goexit()
    /usr/src/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
    /usr/src/go/src/runtime/mgc0.go:82
runtime.goexit()
    /usr/src/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 4 [runnable]:
runtime.runfinq()
    /usr/src/go/src/runtime/malloc.go:712
runtime.goexit()
    /usr/src/go/src/runtime/asm_amd64.s:2232 +0x1
agonzalezro commented 9 years ago

Thanks for the feedback @ipedrazas.

Why did you close this?

Even if it was human error it shouldn't panic this way. Could you reopen it and let me know what was wrong?

ipedrazas commented 9 years ago

Oh, the json was not well formed

agonzalezro commented 9 years ago

Fixed here: https://github.com/agonzalezro/polo/commit/a108596f5a6a43630d2da519a198685ca5fdd10f