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

24 lines
362 B
Go

package shrty
import (
"fmt"
"net/http"
)
func CheckURL(d *Data) error {
resp, err := http.Get(d.URL)
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close()
d.HTTPStatusCode = fmt.Sprint(resp.StatusCode)
d.URLFetched = fmt.Sprint(resp.Request.URL)
d.OriginalURL = fmt.Sprint(resp.Request.URL)
d.Domain = resp.Request.URL.Host
return err
}