Official Go implementation of the Ethereum protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
go-ethereum/tests/helper/http.go

24 lines
338 B

package helper
import (
"encoding/json"
"io/ioutil"
"net/http"
)
func CreateTests(uri string, value interface{}) error {
resp, err := http.Get(uri)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, err := ioutil.ReadAll(resp.Body)
err = json.Unmarshal(data, &value)
if err != nil {
return err
}
return nil
}