2020-04-19

Note

type RoundTripFunc func(req *http.Request) *http.Response

func (f RoundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) {
    return f(req), nil
}

func NewTestClient(fn RoundTripFunc) *http.Client {
    return &http.Client{
        Transport: RoundTripFunc(fn),
    }
}
d-kuro
d-kuro
Software Engineer

I’m a software engineer interested in Kubernetes and other cloud-native technologies.