func ReadPluginConfig(plugin string) ([]byte, error) {
	c, err := GetConfigPath(plugin)
	if err != nil {
		log.WithFields(log.Fields{
			"plugin": plugin,
			"path":   c.Path,
			"error":  err,
		}).Error("Can't read config file")
	}
	file, e := ioutil.ReadFile(c.Path)
	if e != nil {
		return nil, e
	}
	return file, nil
}
ReadPluginConfig - Reads the file from the expected path and returns it as bytes
package plugins
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"os"
	"path"
	"path/filepath"
	"strings"
	log "github.com/Sirupsen/logrus"
	"github.com/amonapp/amonagent/internal/settings"
)
type ConfiguredPlugin struct {
	Name   string
	Plugin Plugin
}
type PluginConfig struct {
	Path string
	Name string
}
var PluginConfigPath = path.Join(settings.ConfigPath, "plugins-enabled")
func GetConfigPath(plugin string) (PluginConfig, error) {
	config := PluginConfig{}
	var pluginPath = path.Join(PluginConfigPath, strings.Join([]string{plugin, "conf"}, "."))
	config.Path = pluginPath
	config.Name = plugin
	return config, nil
}