Skip to content

Commit

Permalink
update function name, fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
doublerr committed Jul 17, 2014
1 parent 109abf4 commit 87828a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import "fmt"
import "github.com/doublerr/goDiscoverEtcd"

func main() {
url := goDiscoverEtcd.GetURL()
url := goDiscoverEtcd.GetDiscoveryURL()
fmt.Printf(url)
}
```
Expand Down
12 changes: 7 additions & 5 deletions goDiscoverEtcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ package goDiscoverEtcd
import "net/http"
import "io/ioutil"

// GetURL issues a GET request against the URL https://discovery.etcd.io/new
// GetDiscoveryURL issues a GET request against the URL https://discovery.etcd.io/new
// returns a string containing your specific URL.
// returns a string of zero length if it has a error
func GetURL() string {
func GetDiscoveryURL() string {

discoveryURL := "https://discovery.etcd.io/new"

resp, err := http.Get(discoveryURL)
defer resp.Body.Close()

url := "https://discovery.etcd.io/new"
resp, err := http.Get(url)
if err != nil {
return ""
}
defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
if err != nil {
Expand Down

0 comments on commit 87828a3

Please sign in to comment.