internal/mcp: avoid JSON nulls on the wire
Add a test that checks for JSON null on the wire, and fix two categories of bugs leading to null: 1. In many places, we could pass typed nil where we shouldn't have. Add an orZero helper to avoid typed nills. 2. When listing roots, we should avoid nil. Fixes golang/go#74105 Change-Id: I061420487dbfcbf9016cb94b39bd72270e871c0e Reviewed-on: https://go-review.googlesource.com/c/tools/+/682675 Reviewed-by: Sam Thanawalla <samthanawalla@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
5ae2a9f222
commit
927070053a
1 changed files with 104 additions and 21 deletions
|
|
@ -120,7 +120,6 @@ func TestClientPaginateBasic(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
listFunc := func(ctx context.Context, params *ListTestParams) (*ListTestResult, error) {
|
||||
if len(tc.results) == 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue