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

panic with some cases #3

Closed
hogedigo opened this issue Feb 7, 2019 · 3 comments
Closed

panic with some cases #3

hogedigo opened this issue Feb 7, 2019 · 3 comments

Comments

@hogedigo
Copy link
Contributor

hogedigo commented Feb 7, 2019

It would cause panic with cases below.

  • only type definition without constants.
  • no comment after a constant.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x10dfd7a]

goroutine 1 [running]:
github.com/knightso/enameg.newConst(0xc42009ec90, 0xd, 0xc420078270, 0x0, 0x0, 0x0, 0x0, 0x0)
       /Users/xxxxxx/vendor/src/src/github.com/knightso/enameg/enameg.go:177 +0x12a
github.com/knightso/enameg.Generate(0xc4200c6000, 0x113, 0x1f3, 0x113, 0x1f3, 0x6, 0x0)
       /Users/xxxxxxx/vendor/src/src/github.com/knightso/enameg/enameg.go:79 +0x3e0
main.main()
       /Users/xxxxxxx/vendor/src/src/github.com/knightso/enameg/cmd/enameg/main.go:45 +0xa8
@hogedigo
Copy link
Contributor Author

hogedigo commented Feb 7, 2019

follow-up report.

  • only type definition without constants.

It would not cause panic.
Please just check it.

@hogedigo
Copy link
Contributor Author

hogedigo commented Feb 7, 2019

one more case.

  • double quotation " in a constant comment.

hogedigo added a commit that referenced this issue Feb 8, 2019
@hogedigo
Copy link
Contributor Author

hogedigo commented Feb 8, 2019

fixed with #5

@hogedigo hogedigo closed this as completed Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant