func (v *vmPool) LintCode(diagnosticFile string, code Code) error {
	vm := v.pool.Get().(*vm)
	err := vm.LintCode(diagnosticFile, code)
	v.pool.Put(vm)
	return err
}
LintCode implements the interface method.
package vm
import (
	"bytes"
	"fmt"
	"os"
	"path/filepath"
	"sync"
	"github.com/google/go-jsonnet"
	"github.com/google/go-jsonnet/linter"
	"github.com/splunk/qbec/vm/datasource"
	"github.com/splunk/qbec/vm/internal/importers"
	"github.com/splunk/qbec/vm/internal/natives"
)
type Code struct {
	code string
}
func MakeCode(s string) Code {
	return Code{code: s}
}
type Config struct {
	LibPaths    []string                 
	DataSources []datasource.DataSource  
}
type VM interface {
	EvalFile(file string, v VariableSet) (string, error)
	EvalCode(diagnosticFile string, code Code, v VariableSet) (string, error)
	LintCode(diagnosticFile string, code Code) error
}
type vm struct {
	jvm *jsonnet.VM
}
func (v *vm) EvalFile(file string, vars VariableSet) (string, error) {
	s, err := os.Stat(file)
	if err != nil {
		if os.IsNotExist(err) {
			return "", fmt.Errorf("%s: file not found", file)
		}
		return "", err
	}
	if s.IsDir() {
		return "", fmt.Errorf("file '%s' was a directory", file)
	}
	vars.register(v.jvm)
	file = filepath.ToSlash(file)
	return v.jvm.EvaluateFile(file)
}
func (v *vm) EvalCode(diagnosticFile string, code Code, vars VariableSet) (string, error) {
	vars.register(v.jvm)
	return v.jvm.EvaluateAnonymousSnippet(diagnosticFile, code.code)
}
func (v *vm) LintCode(diagnosticFile string, code Code) (outErr error) {
	_, err := jsonnet.SnippetToAST(diagnosticFile, code.code)
	if err != nil {
		return err
	}
	defer func() {
		if r := recover(); r != nil {
			outErr = fmt.Errorf("%s: linter panic", diagnosticFile)
		}
	}()
	var b bytes.Buffer
	failure := linter.LintSnippet(v.jvm, &b, diagnosticFile, code.code)
	if failure {
		return fmt.Errorf(b.String())
	}
	return nil
}
type vmPool struct {
	pool sync.Pool
}
func newPool(config Config) *vmPool {
	return &vmPool{
		pool: sync.Pool{
			New: func() interface{} {
				return &vm{jvm: newJsonnetVM(config)}
			},
		},
	}
}
func (v *vmPool) EvalFile(file string, vars VariableSet) (string, error) {
	vm := v.pool.Get().(*vm)
	out, err := vm.EvalFile(file, vars)
	v.pool.Put(vm)
	return out, err
}
func (v *vmPool) EvalCode(diagnosticFile string, code Code, vars VariableSet) (string, error) {
	vm := v.pool.Get().(*vm)
	out, err := vm.EvalCode(diagnosticFile, code, vars)
	v.pool.Put(vm)
	return out, err
}