delve/_fixtures/testnextnethttp.go
Alessandro Arzilli 7b19fe9e69 proc: add test for attach/detach, fix detach (#773)
Detach did not work for processes we attach to via PID.

Linux: we were only detaching from the main thread, all threads are
detached independently

Windows: we must resume all threads before detaching.

macOS: still broken.

Updates #772
2017-03-28 09:30:27 -07:00

25 lines
517 B
Go

package main
import (
"net/http"
"runtime"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
runtime.Breakpoint()
msg := "hello, world!"
header := w.Header().Get("Content-Type")
w.Write([]byte(msg + header))
})
http.HandleFunc("/nobp", func(w http.ResponseWriter, req *http.Request) {
msg := "hello, world!"
header := w.Header().Get("Content-Type")
w.Write([]byte(msg + header))
})
err := http.ListenAndServe(":9191", nil)
if err != nil {
panic(err)
}
}