1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package xmrpayclnt import ( "fmt" "net/http" ) type errResp struct { resp *http.Response wantStatus int } func (e errResp) Error() string { req := e.resp.Request return fmt.Sprintf("%s %s: %s (expected %d)", req.Method, req.URL, e.resp.Status, e.wantStatus) }