Build issue with beats in project using go.mod

Hey all!
I have a project depending on beats/libbeat and after changing my dependency management to go modules I can no longer build the project. It fails with the following message:

unknown import path "": cannot find module providing package
../../../../pkg/mod/ unknown import path "": cannot find module providing package

In my go.mod I require v7.0.0+incompatible v1.0.0 // indirect

and the problem seems to be that the file /libbeat/publisher/processing/default.go imports which previously downloaded the actual folder containing all the go files from the repo (?). But now that I require v1.0.0 in my go.mod it pulls the ecs release which does not contain any go files at all.

Am I interpreting this correctly? Can others confirm that they can not build their projects with go mod when depending on libbeat? Do you have any solution for me on how to fix the build?

Uff... I don't think beats or the ecs package os go modules ready. Beats/libbeat have a common release cycle with all elastic stack projects, which is why it doesn't really follow semver.

when using go modules, it doesn't care what you downloaded previously. go modules only care about what is available via the mod file. I can only guess, as I haven't tried this myself, but I assume that your dependency in the go.mod file should be: // indirect.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.