m1 / go-localize

i18n (Internationalization and localization) engine written in Go, used for translating locale strings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

segmentation violation when input directory doesn't exist

reuvenharrison opened this issue · comments

To replicate, in go-localize root, run:

go-localize -input localizations_src -output localizations

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

goroutine 1 [running]:
main.getLocalizationFiles.func1({0x7ff7bfeff3f3, 0x11}, {0x0?, 0x0?}, {0xc000074200?, 0x0?})
/Users/Reuven/view/go/src/github.com/m1/go-localize/main.go:88 +0x7e
path/filepath.Walk({0x7ff7bfeff3f3, 0x11}, 0xc00012be90)
/usr/local/go/src/path/filepath/path.go:570 +0x4a
main.getLocalizationFiles({0x7ff7bfeff3f3?, 0x10fd1ea?})
/Users/Reuven/view/go/src/github.com/m1/go-localize/main.go:86 +0x48
main.run(0xc000108000?, 0xc0000140b0?)
/Users/Reuven/view/go/src/github.com/m1/go-localize/main.go:57 +0x7a
main.main()
/Users/Reuven/view/go/src/github.com/m1/go-localize/main.go:46 +0x6e