summaryrefslogtreecommitdiff
path: root/check.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-02-19 01:23:44 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-02-19 01:23:44 +0100
commitdc152722044f4be94fe344c46cdf2c1e0cdd1806 (patch)
treeb975a205c127d46dd8a98845eed6b4b5b78844db /check.go
parentd9eebc8feb68035941c005ddfa45995559c967eb (diff)
Kind of working
Diffstat (limited to 'check.go')
-rw-r--r--check.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/check.go b/check.go
index b61bb66..f66813e 100644
--- a/check.go
+++ b/check.go
@@ -3,7 +3,7 @@ package main
import (
"bytes"
"encoding/hex"
- "errors"
+ "fmt"
"io/ioutil"
"math/rand"
"net/http"
@@ -14,8 +14,6 @@ func init() {
rand.Seed(time.Now().UnixNano())
}
-var errDiffer = errors.New("key differs")
-
func Key() string {
b := make([]byte, 16)
for i := range b {
@@ -37,7 +35,7 @@ func Check(uri string) error {
}
body = bytes.TrimSpace(body)
if string(body) != key {
- return errDiffer
+ return fmt.Errorf("%v down", uri)
}
return nil
}