MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin / fetch

Method fetch

plugin/pig/pig.go:194–206  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192}
193
194func (img *pigImage) fetch() ([]byte, error) {
195 if img.Filename == "" {
196 return nil, errors.New("图片数据异常,缺少文件名")
197 }
198
199 targetPath := "assets/" + img.Filename
200 imgData, err := engine.GetLazyData(targetPath, true)
201 if err != nil {
202 return nil, errors.New("图片资源缺失 (" + targetPath + "): " + err.Error())
203 }
204
205 return imgData, nil
206}

Callers 1

initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected