/all folder and go.mod

I’m slightly confused with the below. Please help me understand.

What is the actual purpose of the .go files in “/all/” folder in plugins/inputs/ and plugins/output

If I remove any plugin related file from the “/all/” folder, will it remove the dependencies w.r.t that plugin from go.mod file.

It would be easier to discuss this in the #telegraf-dev channel on Slack but anyway…

The files in /all are there to be able to import all plugins by Telegraf. If you want to create a Telegraf binary tailored to your configuration you can “customize” it with a tool and build the custom version. A nice readup can be found in this blog post

Is this what you are looking for? If not, what are you trying to do?

Thank you so much for the response.

My usecase is - I’m trying to keep only the custom plugins and remove the remaining plugins so that my go.mod file doesn’t carry unused dependencies.
This way I can maintain the telegraf application easily.

Now my doubt is, if I remove the go files related to these unused plugins from the /all folder will the dependencies be removed from go.mod.

Please suggest any cleaner approach if I can use.

You don’t need to delete anything, if you set the build tags accordingly, the plugin packages will not be used and as a consequence the dependencies in the go.mod files will not be pulled into the resulting binary. I suggest you try the customization mentioned in the blog-post and check the results…