-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add prefix and suffix assertions #629
base: master
Are you sure you want to change the base?
Conversation
So I'm not really sure why, but I can't get the generate script to run locally...
If I switch to using a source importer ( |
@ernesto-jimenez I can't seem to get the code generation to work in all versions of Go, even on master, any thoughts? |
+1 for this PR :) |
It looks like #620 will fix the build. |
Another +1 for this addition |
2da4bb9
to
f52b7e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code must be rebased before review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many irrelevant changes in this PR: changing the codegen system should be separated from changes adding new features.
@@ -3,6 +3,9 @@ | |||
*.a | |||
*.so | |||
|
|||
# Binaries | |||
codegen | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should not be bundled in this PR.
@@ -1,5 +1,7 @@ | |||
#!/bin/bash | |||
|
|||
echo ".travis.gofmt.sh" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should not be bundled in this PR.
set -e | ||
set -o pipefail | ||
|
||
echo ".travis.gogenerate.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should not be bundled in this PR.
I found myself wanting to make assertions about string and slice prefixes and suffixes so I thought these might make sense for others as well.
I modeled the new assertions off of the existing
Contains
assertion, but I am open to changing it if the maintainers have other preferences.I also changed the code generation script a bit to try to make it pass reliably across all relevant Go versions. If these issues can be resolved some better way I'd be happy to revert my changes.