Commit ce7b9ce6 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Remove test functions

parent 4231fbbf
......@@ -4,7 +4,6 @@ import (
"errors"
"io/ioutil"
"math/big"
"net/http"
"os"
"github.com/mhe/gabi"
......@@ -98,43 +97,3 @@ func (cm *CredentialManager) init(path string) (err error) {
return
}
func Test2(path string) (content string, err error) {
bytes, err := ioutil.ReadFile(path + "/file.txt")
content = string(bytes)
return
}
func Test(path string) (err error) {
err = ioutil.WriteFile(path+"/file.txt", []byte("TEST TEST"), 0755)
return
}
type NetworkHandler interface {
Success(content string)
Error(status int, error string)
}
func TestNetwork(url string, handler NetworkHandler) {
go func() {
resp, err := http.Get(url)
if err != nil {
handler.Error(0, err.Error())
return
}
defer resp.Body.Close()
bytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
handler.Error(0, err.Error())
return
}
content := string(bytes)
if resp.StatusCode < 200 || resp.StatusCode > 208 {
handler.Error(resp.StatusCode, content)
} else {
handler.Success(content)
}
}()
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment