MCPcopy
hub / github.com/apache/answer / GetPicByUrl

Function GetPicByUrl

pkg/htmltext/htmltext.go:192–205  ·  view source on GitHub ↗
(url string)

Source from the content-addressed store, hash-verified

190}
191
192func GetPicByUrl(url string) string {
193 res, err := http.Get(url)
194 if err != nil {
195 return ""
196 }
197 defer func() {
198 _ = res.Body.Close()
199 }()
200 pix, err := io.ReadAll(res.Body)
201 if err != nil {
202 return ""
203 }
204 return string(pix)
205}

Callers 1

RegisterMethod · 0.92

Calls 2

CloseMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected