On Wed, Sep 13, 2017 at 9:06 AM, Ondřej Kupka <ondra....@gmail.com> wrote: > > I am running go test on a set of packages. Some of these packages do contain > tests and some don't. > The packages that don't contain any test files import a Kafka package that > links librdkafka and uses Cgo. > When I run go test with this set of packages I end up getting > > # pkg-config --cflags rdkafka > Package rdkafka was not found in the pkg-config search path. > Perhaps you should add the directory containing `rdkafka.pc' > to the PKG_CONFIG_PATH environment variable > No package 'rdkafka' found pkg-config: > exit status 1 > > I don't understand why it is searching for librdkafka when the packages > actually containing tests do not need it. > It this a bug or a weird feature? It there any way around it, except not > passing in the packages without tests?
`go test` will build all the requested packages in the process of testing them. It will build a package even if it has no tests. That is presumably where your run is failing. I suppose you could consider building a package to be a minimal form of testing it. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.