[ 
https://issues.apache.org/jira/browse/BEAM-13429?focusedWorklogId=708172&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-708172
 ]

ASF GitHub Bot logged work on BEAM-13429:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jan/22 10:14
            Start Date: 13/Jan/22 10:14
    Worklog Time Spent: 10m 
      Work Description: daria-malkova commented on a change in pull request 
#16482:
URL: https://github.com/apache/beam/pull/16482#discussion_r783814894



##########
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:
       Done




-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 708172)
    Remaining Estimate: 0h
            Time Spent: 10m

>  [Playground] Improve preparators by the introducing of builder
> ---------------------------------------------------------------
>
>                 Key: BEAM-13429
>                 URL: https://issues.apache.org/jira/browse/BEAM-13429
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-playground
>            Reporter: Daria Malkova
>            Assignee: Daria Malkova
>            Priority: P3
>              Labels: beam-playground-backend, beam-playground-sprint-6, 
> beam-playground-sprint-7
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Investigate and implement (if need) a usage of a builder for preparators to 
> construct the necessary builders for each SDK/unit-test/not-unit-test



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to