func init() {
	cfgReader = &cfgReaderType{}
	cfgValidator = &schemaValidatorType{}
}
and finally, initialize to set the instance of that variable
package cfgfile
import (
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"strings"
	"github.com/ghodss/yaml"
	"github.com/intelsdi-x/snap/core/serror"
	"github.com/xeipuuv/gojsonschema"
)
type reader interface {
	ReadFile(s string) ([]byte, error)
}
type cfgReaderType struct{}
func (r *cfgReaderType) ReadFile(s string) ([]byte, error) {
	return ioutil.ReadFile(s)
}
var cfgReader reader
type schemaValidator interface {
	validateSchema(schema, cfg string) []serror.SnapError
}
type schemaValidatorType struct{}
func (r *schemaValidatorType) validateSchema(schema, cfg string) []serror.SnapError {
	schemaLoader := gojsonschema.NewStringLoader(schema)
	testDoc := gojsonschema.NewStringLoader(cfg)
	result, err := gojsonschema.Validate(schemaLoader, testDoc)
	var serrors []serror.SnapError
	if err != nil {
		serrors = append(serrors, serror.New(err))
		return serrors
	}
	if result.Valid() {
		return nil
	}
	for _, err := range result.Errors() {
		serr := serror.New(errors.New("Validate schema error"))
		serr.SetFields(map[string]interface{}{
			"value":       err.Value(),
			"context":     err.Context().String("::"),
			"description": err.Description(),
		})
		serrors = append(serrors, serr)
	}
	return serrors
}
var cfgValidator schemaValidator