# Is there a way to use golang.org/x/net/html in my plugin for HTML parsing

**URL:** https://community.traefik.io/t/is-there-a-way-to-use-golang-org-x-net-html-in-my-plugin-for-html-parsing/19324
**Category:** Traefik v2
**Tags:** middleware, plugin
**Created:** [July 21, 2023, 2:22pm UTC](https://community.traefik.io/t/is-there-a-way-to-use-golang-org-x-net-html-in-my-plugin-for-html-parsing/19324 "2023-07-21T14:22:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![OSjoerdWie](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@OSjoerdWie](https://community.traefik.io/u/OSjoerdWie)
#### Post date: [July 21, 2023, 2:22pm UTC](https://community.traefik.io/t/is-there-a-way-to-use-golang-org-x-net-html-in-my-plugin-for-html-parsing/19324/1 "2023-07-21T14:22:30Z")

</div>

For a plugin I have a need to parse HTML. For this, I want to make use of the golang[.]org/x/net/html package. As I can't seem to import it directly (nor via net/html), I installed it in the vendor section of my plugin.

In particular, I would like to add nonces to style and script tags as well as create inline style tags containing attribute based styles for a third party service's returned HTML.

I've got everything working in a stand alone Go program, but it goes wrong when using the code in a plugin.

Unfortunately, when trying to run traefik, I get the following message:  
error: plugins-local\src\myPlugin\vendor\golang.org\x\net\html\parse.go:688:46: cannot use type func(\*html.parser) bool as type func(\*unsafe2.dummy) bool"

How can I resolve this? Is there an alternative?

Tried with Traefik 2.9.6 and 2.10.3.

---

<div class="post-metadata">

### Author: ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)
#### Post date: [July 22, 2023, 7:14pm UTC](https://community.traefik.io/t/is-there-a-way-to-use-golang-org-x-net-html-in-my-plugin-for-html-parsing/19324/2 "2023-07-22T19:14:33Z")

</div>

Does this help ([doc](https://github.com/traefik/plugindemo))?

> Plugin dependencies must be [vendored](https://golang.org/ref/mod#vendoring) for each plugin. Vendored packages should be included in the plugin's GitHub repository. ([Go modules](https://blog.golang.org/using-go-modules) are not supported.)

Alternatively, check how [existing Traefik plugins](https://github.com/topics/traefik-plugin) deal with it.

---

<div class="post-metadata">

### Author: ![OSjoerdWie](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@OSjoerdWie](https://community.traefik.io/u/OSjoerdWie)
#### Post date: [July 24, 2023, 6:33am UTC](https://community.traefik.io/t/is-there-a-way-to-use-golang-org-x-net-html-in-my-plugin-for-html-parsing/19324/3 "2023-07-24T06:33:06Z")

</div>

Thanks for your response. Although I am quite new to Go, as far as I understand I have my dependency vendored; it's about having my own copy of the 3rd party packages I am using, correct? I've got it setup similarly to, e.g., [GitHub - traefik/plugin-simplecache: Simple cache plugin middleware caches responses on disk.](https://github.com/traefik/plugin-simplecache)

As it seems, Yaegi does seem to be able to find the 3rd party code, yet has issues with a construct in that code.
