Use a vendor directory for repeatable builds - fixes #816
This is using godep to manage the vendor directory.
This commit is contained in:
parent
01be5bff02
commit
f7af730b50
637 changed files with 247384 additions and 11 deletions
49
vendor/github.com/stretchr/testify/http/test_response_writer.go
generated
vendored
Normal file
49
vendor/github.com/stretchr/testify/http/test_response_writer.go
generated
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// TestResponseWriter DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
|
||||
type TestResponseWriter struct {
|
||||
|
||||
// StatusCode is the last int written by the call to WriteHeader(int)
|
||||
StatusCode int
|
||||
|
||||
// Output is a string containing the written bytes using the Write([]byte) func.
|
||||
Output string
|
||||
|
||||
// header is the internal storage of the http.Header object
|
||||
header http.Header
|
||||
}
|
||||
|
||||
// Header DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
|
||||
func (rw *TestResponseWriter) Header() http.Header {
|
||||
|
||||
if rw.header == nil {
|
||||
rw.header = make(http.Header)
|
||||
}
|
||||
|
||||
return rw.header
|
||||
}
|
||||
|
||||
// Write DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
|
||||
func (rw *TestResponseWriter) Write(bytes []byte) (int, error) {
|
||||
|
||||
// assume 200 success if no header has been set
|
||||
if rw.StatusCode == 0 {
|
||||
rw.WriteHeader(200)
|
||||
}
|
||||
|
||||
// add these bytes to the output string
|
||||
rw.Output = rw.Output + string(bytes)
|
||||
|
||||
// return normal values
|
||||
return 0, nil
|
||||
|
||||
}
|
||||
|
||||
// WriteHeader DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
|
||||
func (rw *TestResponseWriter) WriteHeader(i int) {
|
||||
rw.StatusCode = i
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue