The %w syntax is a fmt.Errorf thing, not supported by the testing package.
Remove the pubsub.Query interface and instead use the concrete query type. Nothing uses any other implementation but pubsub/query. * query: remove the error from the Matches method * Update all usage.
No API changes, merely changes the import path.