-
Notifications
You must be signed in to change notification settings - Fork 123
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
Flavor getters #177
Flavor getters #177
Conversation
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.
Besides builders updated in this PR, we can also add Flavor() Flavor
in Build
interface and implement this new method in compiledBuilder
and flavoredBuilder
in ./builder.go
.
createtable.go
Outdated
@@ -158,6 +158,10 @@ func (ctb *CreateTableBuilder) SetFlavor(flavor Flavor) (old Flavor) { | |||
return | |||
} | |||
|
|||
func (ctb *CreateTableBuilder) GetFlavor() Flavor { |
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.
The method name should be Flavor
rather than GetFlavor
according to Effective Go. And don't forget to add comment to describe this method.
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.
Done
createtable_test.go
Outdated
func TestCreateTableGetFlavor(t *testing.T) { | ||
a := assert.New(t) | ||
ctb := newCreateTableBuilder() | ||
postgresFlavor := PostgreSQL |
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.
It's not necessary to assign a const to a local variable. Doing this will make the test code less readable. It's recommended to use const in assertions directly.
Thanks for your contribution! I sent you several review comments. Feel free to discuss with me if you have any thought. |
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.
LGTM. Thank you.
No description provided.