mirror of
https://github.com/healthchecks/healthchecks.git
synced 2024-11-23 16:07:39 +00:00
24 lines
329 B
Markdown
24 lines
329 B
Markdown
# Go
|
|
|
|
Below is an example of making an HTTP request to SITE_NAME from Go.
|
|
|
|
```go
|
|
package main
|
|
|
|
import "fmt"
|
|
import "net/http"
|
|
import "time"
|
|
|
|
func main() {
|
|
var client = &http.Client{
|
|
Timeout: 10 * time.Second,
|
|
}
|
|
|
|
_, err := client.Head("PING_URL")
|
|
if err != nil {
|
|
fmt.Printf("%s", err)
|
|
}
|
|
}
|
|
|
|
```
|