Set adds a template to the loader.
(templatePath, contents string)
| 130 | |
| 131 | // Set adds a template to the loader. |
| 132 | func (l *InMemLoader) Set(templatePath, contents string) { |
| 133 | templatePath = l.normalize(templatePath) |
| 134 | l.lock.Lock() |
| 135 | defer l.lock.Unlock() |
| 136 | l.files[templatePath] = []byte(contents) |
| 137 | } |
| 138 | |
| 139 | // Delete removes whatever contents are stored under the given path. |
| 140 | func (l *InMemLoader) Delete(templatePath string) { |