Is this on Windows? Go itself doesn't generate any alerts like this. It's likely that your firewall or antivirus software is doing that. You may have to figure out how to configure them to allow it.
Another thing to consider is, since the client and server are running on the same machine, it's better to listen on "localhost:8080" than ":8080". The former only allows connections from the local machine; the latter allows them from anywhere on the network. This change might also make your protection software happy, stopping the alert. On Tue, Aug 23, 2016 at 2:44 PM Joe Blue <joeble...@gmail.com> wrote: > Hey everyone > > I am building a Desktop application with golang. > The Frontend is Electron, and the Backend if Golang. > They talk over http. > > I have managed to combine the two into a single compile & run, but i need > the backend server to NOT alert when it starts at the > "http.ListenAndServe(":8080", nil)". > The reason being that its just poor user experience. > Any ideas ? > > > func main() { > > // start backend > fmt.Println("starting backend... ") > > http.HandleFunc("/", b.HomeHandler) > http.HandleFunc("/hello/", b.HelloHandler) > http.HandleFunc("/api/test/", b.ApiTestHandler) > > fmt.Println("backend listening on localhost:8080") > go func() { > http.ListenAndServe(":8080", nil) > > }() > > // start frontend > fmt.Println("starting frontend .... ") > > cmd := exec.Command("electron", "../frontend/.") > > var waitStatus syscall.WaitStatus > if err := cmd.Run(); err != nil { > printError(err) > // Did the command fail because of an unsuccessful exit code > if exitError, ok := err.(*exec.ExitError); ok { > waitStatus = exitError.Sys().(syscall.WaitStatus) > printOutput([]byte(fmt.Sprintf("%d", waitStatus.ExitStatus()))) > } > } else { > // Command was successful > waitStatus = cmd.ProcessState.Sys().(syscall.WaitStatus) > printOutput([]byte(fmt.Sprintf("%d", waitStatus.ExitStatus()))) > } > > } > > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.