Created
July 4, 2019 12:24
-
-
Save vkorbes/db1e3b0b19f0b9173c1eda4b3533a159 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func get() string { | |
| // Println debugging! | |
| fmt.Println("Got into func get().") | |
| response, err := http.Get("http://localhost:8080/") | |
| if err != nil { | |
| log.Fatalln(err) | |
| } | |
| // Println debugging! | |
| fmt.Println("Sent GET request.") | |
| message, err := ioutil.ReadAll(response.Body) | |
| if err != nil { | |
| log.Fatalln(err) | |
| } | |
| // Println debugging! | |
| fmt.Println("Got GET response body:", message) | |
| return string(message) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment