segmentio / golines

A golang formatter that fixes long lines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Panic if file is missing `package` declaration

twavv opened this issue · comments

This is probably related to an upstream issue in dave/dst but wanted to flag it here at least just so it's findable if anyone else ever runs into this.

Found this error when the first line of the file was import ( (instead of the usual package <foo> declaration).

I can't reproduce this. In a folder with only one file and with no package declaration, golines doesn't panic for me.

Can you provide a minimum example that leads to the panic? (Also what version of golines and go are you using?)