diff options
| author | Horus_Arch | 2015-02-23 12:13:32 +0100 |
|---|---|---|
| committer | Horus_Arch | 2015-02-23 12:13:32 +0100 |
| commit | 70d080b69a1bce3125d8d0b83e23775880241763 (patch) | |
| tree | 6fac80f9291e361045098b2ce9eb0839652e6b42 /app/utilities.go | |
| parent | 00b28812fb5ab68156ead5b45b66740a4d5ca688 (diff) | |
| download | statuspage-70d080b69a1bce3125d8d0b83e23775880241763.tar.gz | |
Refactor and more unit tests.
Diffstat (limited to 'app/utilities.go')
| -rw-r--r-- | app/utilities.go | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/app/utilities.go b/app/utilities.go index a3c3617..b34efd8 100644 --- a/app/utilities.go +++ b/app/utilities.go @@ -17,22 +17,7 @@ import ( "time" ) -/* -type errorString struct { - s string -} - -func (e *errorString) Error() string { - return e.s -} - -// New returns an error that formats as the given text. -func New(text string) error { - return &errorString{text} -} -*/ - -// Returns headers as map and the content of a webpage as string +// Returns the response from a GET request plus the headers as map and the content as string func HttpGet(url string) (*http.Response, string, error) { r, err := http.Get(url) if err != nil { @@ -59,6 +44,7 @@ func Md5Hash(content string) string { // Creates a random string func RandomKey() string { + rand.Seed(time.Now().UTC().UnixNano()) letters := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") key := make([]rune, 40) for i := range key { |
