Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix deprecation comments for http package #1335

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,7 @@
//
// The assert package provides a comprehensive set of assertion functions that tie in to the Go testing system.
//
// The http package contains tools to make it easier to test http activity using the Go testing system.
//
// The mock package provides a system by which it is possible to mock your objects and verify calls are happening as expected.
//
// The suite package provides a basic structure for using structs as testing suites, and methods on those structs as tests. It includes setup/teardown functionality in the way of interfaces.
package testify

// blank imports help docs.
import (
// assert package
_ "github.com/stretchr/testify/assert"
// http package
_ "github.com/stretchr/testify/http"
// mock package
_ "github.com/stretchr/testify/mock"
)
2 changes: 1 addition & 1 deletion http/doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Package http DEPRECATED USE net/http/httptest
// Deprecated: Use [net/http/httptest] instead.
package http
8 changes: 4 additions & 4 deletions http/test_response_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/http"
)

// TestResponseWriter DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
// Deprecated: Use [net/http/httptest] instead.
type TestResponseWriter struct {

// StatusCode is the last int written by the call to WriteHeader(int)
Expand All @@ -17,7 +17,7 @@ type TestResponseWriter struct {
header http.Header
}

// Header DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
// Deprecated: Use [net/http/httptest] instead.
func (rw *TestResponseWriter) Header() http.Header {

if rw.header == nil {
Expand All @@ -27,7 +27,7 @@ func (rw *TestResponseWriter) Header() http.Header {
return rw.header
}

// Write DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
// Deprecated: Use [net/http/httptest] instead.
func (rw *TestResponseWriter) Write(bytes []byte) (int, error) {

// assume 200 success if no header has been set
Expand All @@ -43,7 +43,7 @@ func (rw *TestResponseWriter) Write(bytes []byte) (int, error) {

}

// WriteHeader DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
// Deprecated: Use [net/http/httptest] instead.
func (rw *TestResponseWriter) WriteHeader(i int) {
rw.StatusCode = i
}
4 changes: 2 additions & 2 deletions http/test_round_tripper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"github.com/stretchr/testify/mock"
)

// TestRoundTripper DEPRECATED USE net/http/httptest
// Deprecated: Use [net/http/httptest] instead.
type TestRoundTripper struct {
mock.Mock
}

// RoundTrip DEPRECATED USE net/http/httptest
// Deprecated: Use [net/http/httptest] instead.
func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
args := t.Called(req)
return args.Get(0).(*http.Response), args.Error(1)
Expand Down
Loading