fuzzitdev/example-go

Restructure example Go

Closed this issue · 2 comments

kjk commented

For a library, an idiomatic Go way of structuring it would be to have the code at the top-level instead of in pkg/parser.

Such naming is usually used when the top-level is an application but the repo also contains re-usable (by others) packages, in which case those re-usable packages are under pkg/.

Also, go-fuzz-build doesn't support multiple-packages so go-fuzz-build -libfuzzer -o fuzzer.a ./... doesn't work in general case.

It only happens to work because there's only one package in this example

This should be go-fuzz-build -libfuzzer -o fuzzer.a . or ``go-fuzz-build -libfuzzer -o fuzzer.a github.com/fuzzitdev/example-go`

I can make a PR.

Sounds right. will be happy for a PR.

Closing as this was merged.