Skip to content

Conversation

erezrokah
Copy link
Member

Summary

When calling .String() on an output type of a generic method the resulting string has the full import path.
For example without this fix the signature returned for the new test is:

NewPager(context.Context) *interfaces.Pager[github.com/cloudquery/codegen/interfaces.Response]"

This PR fixes it by normalizing the signature. Happy to get feedback on the solution if there's a better way to do it.


Use the following steps to ensure your PR is ready to be reviewed

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@github-actions github-actions bot added the feat label Jun 9, 2023
@erezrokah erezrokah requested a review from hermanschaaf June 9, 2023 13:39
@erezrokah erezrokah added the automerge Add to automerge PRs once requirements are met label Jun 9, 2023
@erezrokah erezrokah enabled auto-merge (squash) June 9, 2023 13:40
Copy link
Member

@hermanschaaf hermanschaaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I don't know if there's a better way to do this but this works for now!

@erezrokah erezrokah merged commit f8dc681 into main Jun 9, 2023
@erezrokah erezrokah deleted the feat/support_generic_output_type branch June 9, 2023 13:45
@cq-bot cq-bot mentioned this pull request Jun 12, 2023
kodiakhq bot pushed a commit that referenced this pull request Jun 12, 2023
🤖 I have created a release *beep* *boop*
---


## [0.3.0](v0.2.1...v0.3.0) (2023-06-12)


### ⚠ BREAKING CHANGES

* Service per dir ([#6](#6))
* Support multiple clients in the same package ([#5](#5))

### Features

* Service per dir ([#6](#6)) ([12795c8](12795c8))
* Support generic output type ([#1](#1)) ([f8dc681](f8dc681))
* Support multiple clients in the same package ([#5](#5)) ([db0fd3c](db0fd3c))
* Support packages versions greater than v1 ([#4](#4)) ([19193a6](19193a6))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Add to automerge PRs once requirements are met feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants