ImportString imports a string, caches it and then returns it.
(importedFrom, importedPath string, i *interpreter)
| 152 | |
| 153 | // ImportString imports a string, caches it and then returns it. |
| 154 | func (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. |
| 163 | func (cache *importCache) importBinary(importedFrom, importedPath string, i *interpreter) (*valueArray, error) { |
no test coverage detected