Skip to content

Commit

Permalink
Merge pull request #5 from tucksaun/ci/go-122
Browse files Browse the repository at this point in the history
Add Go 1.22 to the matrix
  • Loading branch information
fabpot committed Feb 12, 2024
2 parents c68b196 + 8b8dc15 commit 193b82f
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- '1.19'
- '1.20'
- '1.21'
- '1.22'
name: Go ${{ matrix.go }} test
steps:
- uses: actions/checkout@v2
Expand Down
25 changes: 1 addition & 24 deletions dumper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,28 +423,5 @@ func (ts *DumperSuite) TestPrivateFields(c *C) {
}`)

RegisterCustomDumper(http.Request{}, DumpStructWithPrivateFields)
c.Assert(Sdump(http.Request{}), DumpEquals, `http.Request{
Method: "",
URL: nil, // &url.URL
Proto: "",
ProtoMajor: 0,
ProtoMinor: 0,
Header: nil, // map[string][]string
Body: nil,
GetBody: nil, // func() (io.ReadCloser, error)
ContentLength: 0, // int64
TransferEncoding: nil, // []string
Close: false,
Host: "",
Form: nil, // map[string][]string
PostForm: nil, // map[string][]string
MultipartForm: nil, // &multipart.Form
Trailer: nil, // map[string][]string
RemoteAddr: "",
RequestURI: "",
TLS: nil, // &tls.ConnectionState
Cancel: nil, // <-chan struct {}
Response: nil, // &http.Response
ctx: nil,
}`)
c.Assert(Sdump(http.Request{}), DumpEquals, httpRequestExceptedDumpWithPrivateFields)
}
28 changes: 28 additions & 0 deletions dumper_test_http.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//go:build !go1.22

package dumper

const httpRequestExceptedDumpWithPrivateFields = `http.Request{
Method: "",
URL: nil, // &url.URL
Proto: "",
ProtoMajor: 0,
ProtoMinor: 0,
Header: nil, // map[string][]string
Body: nil,
GetBody: nil, // func() (io.ReadCloser, error)
ContentLength: 0, // int64
TransferEncoding: nil, // []string
Close: false,
Host: "",
Form: nil, // map[string][]string
PostForm: nil, // map[string][]string
MultipartForm: nil, // &multipart.Form
Trailer: nil, // map[string][]string
RemoteAddr: "",
RequestURI: "",
TLS: nil, // &tls.ConnectionState
Cancel: nil, // <-chan struct {}
Response: nil, // &http.Response
ctx: nil,
}`
31 changes: 31 additions & 0 deletions dumper_test_http_122.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//go:build go1.22

package dumper

const httpRequestExceptedDumpWithPrivateFields = `http.Request{
Method: "",
URL: nil, // &url.URL
Proto: "",
ProtoMajor: 0,
ProtoMinor: 0,
Header: nil, // map[string][]string
Body: nil,
GetBody: nil, // func() (io.ReadCloser, error)
ContentLength: 0, // int64
TransferEncoding: nil, // []string
Close: false,
Host: "",
Form: nil, // map[string][]string
PostForm: nil, // map[string][]string
MultipartForm: nil, // &multipart.Form
Trailer: nil, // map[string][]string
RemoteAddr: "",
RequestURI: "",
TLS: nil, // &tls.ConnectionState
Cancel: nil, // <-chan struct {}
Response: nil, // &http.Response
ctx: nil,
pat: nil, // &http.pattern
matches: nil, // []string
otherValues: nil, // map[string]string
}`

0 comments on commit 193b82f

Please sign in to comment.