If the function to defer is a method of a binary object, the method function must be resolved during defer. All other cases are already handled.
17 lines
198 B
Go
17 lines
198 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
)
|
|
|
|
func main() {
|
|
println("hello")
|
|
mux := http.NewServeMux()
|
|
server := httptest.NewServer(mux)
|
|
defer server.Close()
|
|
}
|
|
|
|
// Output:
|
|
// hello
|