# Writing Plugin in Go Errors

**URL:** <https://discourse.crowdsec.net/t/writing-plugin-in-go-errors/372>\
**Category:** crowdsec\
**Created:** [December 1, 2021, 1:56am UTC](https://discourse.crowdsec.net/t/writing-plugin-in-go-errors/372 "2021-12-01T01:56:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vdmamaril06](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/vdmamaril06/32/195_2.png) [@vdmamaril06](https://discourse.crowdsec.net/u/vdmamaril06)\
**Post date:** [December 1, 2021, 1:56am UTC](https://discourse.crowdsec.net/t/writing-plugin-in-go-errors/372/1 "2021-12-01T01:56:16Z")

</div>

When running “go build” I encounter the error below.

 ![Screenshot 2021-12-01 at 9.48.20 AM](https://europe1.discourse-cdn.com/flex013/uploads/crowdsec/original/1X/281c30074ca6b16c742696cd650a17be1159c6db.png)

I have installed dependencies using “go tidy” and copy and pasted all commands in the documentation: [Writing Plugin in Go | CrowdSec](https://docs.crowdsec.net/docs/next/notification_plugins/writing_your_own_plugin/)

Any solution for this?

Thanks!

---

<div class="post-metadata">

**Author:** ![sbs2001](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/sbs2001/32/197_2.png) [@sbs2001](https://discourse.crowdsec.net/u/sbs2001)\
**Post date:** [December 2, 2021, 11:50am UTC](https://discourse.crowdsec.net/t/writing-plugin-in-go-errors/372/2 "2021-12-02T11:50:39Z")

</div>

@vdmamaril06 There was a mistake in docs which caused this. I have made PR to fix it.

You can fix this by changing the Notifier interface to

```auto
type Notifier interface {
    Configure(ctx context.Context, config *protobufs.Config) (*protobufs.Empty, error)
    Notify(ctx context.Context, notification *protobufs.Notification) (*protobufs.Empty, error)
}

```

Also there’s a more complete version of the plugin at [crowdsec/plugins/notifications/email at add\_email\_plugin · sbs2001/crowdsec · GitHub](https://github.com/sbs2001/crowdsec/tree/add_email_plugin/plugins/notifications/email) . It will be built in crowdsec soon.

---

<div class="post-metadata">

**Author:** ![vdmamaril06](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/vdmamaril06/32/195_2.png) [@vdmamaril06](https://discourse.crowdsec.net/u/vdmamaril06)\
**Post date:** [December 9, 2021, 12:00am UTC](https://discourse.crowdsec.net/t/writing-plugin-in-go-errors/372/3 "2021-12-09T00:00:04Z")

</div>

Thanks @sbs2001. I was able to build the email plugin however I am unable to start crowdsec when it is in the plugins folder. What could I be missing?

---

<div class="post-metadata">

**Author:** ![sbs2001](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/sbs2001/32/197_2.png) [@sbs2001](https://discourse.crowdsec.net/u/sbs2001)\
**Post date:** [December 9, 2021, 9:22am UTC](https://discourse.crowdsec.net/t/writing-plugin-in-go-errors/372/4 "2021-12-09T09:22:29Z")

</div>

@vdmamaril06 could you paste the logs from /var/log/crowdsec.log ? So we could understand what’s happening.

My guess is that this was caused because the plugin binary needs to be pasted in the /usr/local/lib/crowdsec/plugins/ instead of /var/lib/crowdsec/plugins/ . We would be updating the docs very soon after merging [Add email notification plugin. by sbs2001 · Pull Request #1013 · crowdsecurity/crowdsec · GitHub](https://github.com/crowdsecurity/crowdsec/pull/1013) .
