package main
import ( "fmt" "io" "net/http" "net/http/httptest" "os" "time")
type reader int
func (r *reader) Read(p []byte) (int, error) { time.Sleep(time.Millisecond) *r++ return copy(p, fmt.Sprintf("hello %d\n", *r)), nil}
func handler(w http.ResponseWriter, req *http.Request) { io.Copy(os.Stdout, req.Body)}
func main() { s := httptest.NewServer(http.HandlerFunc(handler)) r := new(reader) req, _ := http.NewRequest("POST", s.URL, r) req.ContentLength = -1}--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.