Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleHandle (0.19 sec)

  1. src/net/http/example_handle_test.go

    	n  int
    }
    
    func (h *countHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    	h.mu.Lock()
    	defer h.mu.Unlock()
    	h.n++
    	fmt.Fprintf(w, "count is %d\n", h.n)
    }
    
    func ExampleHandle() {
    	http.Handle("/count", new(countHandler))
    	log.Fatal(http.ListenAndServe(":8080", nil))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 02 16:59:25 UTC 2018
    - 560 bytes
    - Viewed (0)
Back to top