# Build issue with beats in project using go.mod

**URL:** <https://discuss.elastic.co/t/build-issue-with-beats-in-project-using-go-mod/178249>\
**Category:** Beats\
**Created:** [April 24, 2019, 12:27pm UTC](https://discuss.elastic.co/t/build-issue-with-beats-in-project-using-go-mod/178249 "2019-04-24T12:27:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielw93](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@danielw93](https://discuss.elastic.co/u/danielw93)\
**Post date:** [April 24, 2019, 12:27pm UTC](https://discuss.elastic.co/t/build-issue-with-beats-in-project-using-go-mod/178249/1 "2019-04-24T12:27:47Z")

</div>

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 "[github.com/elastic/beats/libbeat/publisher/bc/publisher](http://github.com/elastic/beats/libbeat/publisher/bc/publisher)": cannot find module providing package [github.com/elastic/beats/libbeat/publisher/bc/publisher](http://github.com/elastic/beats/libbeat/publisher/bc/publisher)  
> ../../../../pkg/mod/github.com/elastic/beats@v7.0.0+incompatible/libbeat/publisher/processing/default.go:23:2: unknown import path "[github.com/elastic/ecs/code/go/ecs](http://github.com/elastic/ecs/code/go/ecs)": cannot find module providing package [github.com/elastic/ecs/code/go/ecs](http://github.com/elastic/ecs/code/go/ecs)

In my go.mod I require  
`github.com/elastic/beats v7.0.0+incompatible`  
`github.com/elastic/ecs v1.0.0 // indirect`

and the problem seems to be that the file `/libbeat/publisher/processing/default.go` imports `github.com/elastic/ecs/code/go/ecs` which previously downloaded the actual folder containing all the go files from the repo (?). But now that I require [GitHub - elastic/ecs: Elastic Common Schema](http://github.com/elastic/ecs) 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?

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [April 25, 2019, 10:09am UTC](https://discuss.elastic.co/t/build-issue-with-beats-in-project-using-go-mod/178249/2 "2019-04-25T10:09:31Z")

</div>

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: `github.com/elastic/ecs/code/go/ecs // indirect`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 23, 2019, 12:09pm UTC](https://discuss.elastic.co/t/build-issue-with-beats-in-project-using-go-mod/178249/3 "2019-05-23T12:09:35Z")

</div>

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