MCPcopy
hub / github.com/google/go-jsonnet / importString

Method importString

imports.go:154–160  ·  view source on GitHub ↗

ImportString imports a string, caches it and then returns it.

(importedFrom, importedPath string, i *interpreter)

Source from the content-addressed store, hash-verified

152
153// ImportString imports a string, caches it and then returns it.
154func (cache *importCache) importString(importedFrom, importedPath string, i *interpreter) (valueString, error) {
155 data, _, err := cache.importData(importedFrom, importedPath)
156 if err != nil {
157 return nil, i.Error(err.Error())
158 }
159 return makeValueString(data.String()), nil
160}
161
162// ImportString imports an array of bytes, caches it and then returns it.
163func (cache *importCache) importBinary(importedFrom, importedPath string, i *interpreter) (*valueArray, error) {

Callers 1

rawevaluateMethod · 0.80

Calls 4

importDataMethod · 0.95
makeValueStringFunction · 0.85
ErrorMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected