I am trying out gomobile and want to send some data to a webserver before the app starts. I am using the basic example app template included in gomobile. I added the code at the start of main:
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "X.X.X.X:8000/log", strings.NewReader("TEST"))
client.Do(req)
app.Main(func(a app.App) {
...
}
....
}
The app immediately crashes on start up. I am certain I used the correct IP in the GET request.
Is there anything wrong with how the HTTP request is made?
(I am testing on Android)