1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 type shutdownCodec
struct {
17 func (c
*shutdownCodec
) WriteRequest(*Request
, interface{}) error
{ return nil }
18 func (c
*shutdownCodec
) ReadResponseBody(interface{}) error
{ return nil }
19 func (c
*shutdownCodec
) ReadResponseHeader(*Response
) error
{
21 return errors
.New("shutdownCodec ReadResponseHeader")
23 func (c
*shutdownCodec
) Close() error
{
28 func TestCloseCodec(t
*testing
.T
) {
29 codec
:= &shutdownCodec
{responded
: make(chan int)}
30 client
:= NewClientWithCodec(codec
)
34 t
.Error("client.Close did not close codec")