daria-malkova commented on a change in pull request #16482:
URL: https://github.com/apache/beam/pull/16482#discussion_r783029980
##########
File path: playground/backend/internal/preparators/go_preparators.go
##########
@@ -33,13 +31,44 @@ const (
sep = "."
)
+//GoPreparersBuilder facet of PreparersBuilder
+type GoPreparersBuilder struct {
+ PreparersBuilder
+}
+
+//GoPreparers chains to type *PreparersBuilder and returns a
*GoPreparersBuilder
+func (b *PreparersBuilder) GoPreparers() *GoPreparersBuilder {
+ return &GoPreparersBuilder{*b}
+}
+
+//WithCodeFormatter adds code formatter preparer
+func (a *GoPreparersBuilder) WithCodeFormatter() *GoPreparersBuilder {
+ formatCodePreparator := Preparator{
+ Prepare: formatCode,
+ Args: []interface{}{a.filePath},
+ }
+ a.AddPreparer(formatCodePreparator)
+ return a
+}
+
+//WithFileNameChanger adds preparer to change file name
+func (a *GoPreparersBuilder) WithFileNameChanger() *GoPreparersBuilder {
+ changeTestFileName := Preparator{
+ Prepare: changeGoTestFileName,
+ Args: []interface{}{a.filePath},
+ }
+ a.AddPreparer(changeTestFileName)
+ return a
+}
+
// GetGoPreparators returns reparation methods that should be applied to Go
code
-func GetGoPreparators(filePath string) *[]Preparator {
- preparatorArgs := make([]interface{}, 1)
- preparatorArgs[0] = filePath
- formatCodePreparator := Preparator{Prepare: formatCode, Args:
preparatorArgs}
- changeNamePreparator := Preparator{Prepare: changeGoTestFileName, Args:
preparatorArgs}
- return &[]Preparator{formatCodePreparator, changeNamePreparator}
+func GetGoPreparators(builder *PreparersBuilder, isUnitTest bool) {
Review comment:
For now I haven't made renaming because I want only builder changes (it
is easy to review)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]