You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-fly/tools/http.go

20 lines
257 B

package tools
import (
"io/ioutil"
"net/http"
)
func Get(url string) string {
res, err := http.Get(url)
if err != nil {
return ""
}
robots, err := ioutil.ReadAll(res.Body)
res.Body.Close()
if err != nil {
return ""
}
return string(robots)
}