MCPcopy Create free account
hub / github.com/PuerkitoBio/fetchbot / ErrorFor

Method ErrorFor

fetch_test.go:72–86  ·  view source on GitHub ↗
(rawurl string)

Source from the content-addressed store, hash-verified

70}
71
72func (sh *spyHandler) ErrorFor(rawurl string) error {
73 sh.mu.Lock()
74 defer sh.mu.Unlock()
75 ix := -1
76 for i, c := range sh.cmds {
77 if c.URL().String() == rawurl {
78 ix = i
79 break
80 }
81 }
82 if ix >= 0 {
83 return sh.errs[ix]
84 }
85 return nil
86}
87
88func (sh *spyHandler) StatusFor(rawurl string) int {
89 sh.mu.Lock()

Callers 1

TestFetchDisallowedFunction · 0.95

Calls 1

URLMethod · 0.65

Tested by

no test coverage detected