github.com/traefik/yaegi@v0.15.1/_test/map17.go (about)

     1  package main
     2  
     3  import "net/http"
     4  
     5  type T struct {
     6  	header string
     7  }
     8  
     9  func (b *T) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
    10  	if b.header != "" {
    11  		req.Header[b.header] = []string{"hello"}
    12  	}
    13  }
    14  
    15  func main() {
    16  	println("ok")
    17  }
    18  
    19  // Output:
    20  // ok