Conditions | 1 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | package utils |
||
10 | func GetHTMLFromTargetURL(url string) string { |
||
11 | resp, err := http.Get(url) |
||
12 | HandleError(err, "Can't connect to "+url) |
||
13 | |||
14 | body, err := ioutil.ReadAll(resp.Body) |
||
15 | HandleError(err, "Can't read body") |
||
16 | |||
17 | err = resp.Body.Close() |
||
18 | HandleError(err, "Error while trying to close body") |
||
19 | |||
20 | return string(body) |
||
21 | } |
||
22 |