feat(spec): Add source, destination String methods#609
feat(spec): Add source, destination String methods#609kodiakhq[bot] merged 3 commits intocloudquery:mainfrom
Conversation
a0bbabd to
a2f5806
Compare
⏱️ Benchmark resultsComparing with 3d3f20f
|
yevgenypats
left a comment
There was a problem hiding this comment.
String is a saved method in Go and usually means that it stringify the whole object. so let's say if we use fmt.Printf(spec) this will now print the version instead of the string.
Can we just use VersionString method for this?
Isn't that what overriding
Using We can have a dedicated method, but that means we have to call it before passing the spec to any method that does formatting. That's especially clunky for arrays as you'll need to iterate over the array and call the method per item |
I don't think this is what we want or at least for me it was quite confusing as I would assume |
Cool, got it. I'll make the function explicit |
|
Done in 734f49c cc @yevgenypats |
🤖 I have created a release *beep* *boop* --- ## [1.27.0](v1.26.0...v1.27.0) (2023-01-17) ### Features * **spec:** Add source, destination String methods ([#609](#609)) ([604b9ef](604b9ef)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
#### Summary To go with cloudquery/plugin-sdk#609. Examples   <!--
Summary
A user recently ran into some issues since they thought they used a newer version of a plugin, but actually used an old one.
This PR adds
String()methods to specs so we can use them in logs/errors.CLI PR cloudquery/cloudquery#6842
Use the following steps to ensure your PR is ready to be reviewed
go fmtto format your code 🖊golangci-lint run🚨 (install golangci-lint here)