lucapette / fakedata

CLI utility for fake data generation
MIT License
200 stars 7 forks source link

Getting runtime error while want to see help for 'date' #63

Closed oltoko closed 7 years ago

oltoko commented 7 years ago

Description

I want to see the description of the date generator and it gives me a runtime error!

Steps To Reproduce

Use Version v1.1.0 of fakedata installed with brew install lucapette/tap/fakedata on macOS 10.12.6. Type fakedata -g date into a Terminal.

Expected result

The description of the date generator

Actual result

The following was printed in the Terminal:

Description: random date in the format YYYY-MM-DD. By default, it generates dates in the last year

Example:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x112b8ad]

goroutine 1 [running]:
main.main()
    /Users/lucapette/src/github.com/lucapette/fakedata/main.go:127 +0x9dd
lucapette commented 7 years ago

@oltoko thank you for such a great report! I'll try to get to it as soon as I can!

KevinGimbel commented 7 years ago

@lucapette I took a quick look and it seems to be related to generators which take arguments.

$ fakedata -g int
Description: positive integer between 1 and 1000

Example:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x112b8ad]

goroutine 1 [running]:
main.main()
    /Users/lucapette/src/github.com/lucapette/fakedata/main.go:127 +0x9dd
$ fakedata -g enum
Description: value from an enum. By default, the enum is foo,bar,baz. It accepts a list of comma-separated values

Example:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x112b8ad]

goroutine 1 [running]:
main.main()
    /Users/lucapette/src/github.com/lucapette/fakedata/main.go:127 +0x9dd
lucapette commented 7 years ago

@oltoko I just released v1.1.1 that fixes this bug. thank you so much for reporting it!

oltoko commented 7 years ago

It worked! This was an instant fix, thank you very much!