ceocoder commented on a change in pull request #12683:
URL: https://github.com/apache/beam/pull/12683#discussion_r479531914



##########
File path: sdks/go/pkg/beam/io/textio/textio.go
##########
@@ -79,6 +81,7 @@ func expandFn(ctx context.Context, glob string, emit 
func(string)) error {
 }
 
 func readFn(ctx context.Context, filename string, emit func(string)) error {
+       fmt.Println(filename)

Review comment:
       yikes.  yes - this was my bad. 

##########
File path: sdks/go/pkg/beam/io/textio/textio.go
##########
@@ -93,11 +96,18 @@ func readFn(ctx context.Context, filename string, emit 
func(string)) error {
        }
        defer fd.Close()
 
-       scanner := bufio.NewScanner(fd)
-       for scanner.Scan() {
-               emit(scanner.Text())
+       rd := bufio.NewReader(fd)
+       for {
+               line, err := rd.ReadString('\n')
+               if err == io.EOF {

Review comment:
       ack. done.

##########
File path: sdks/go/pkg/beam/io/textio/textio.go
##########
@@ -93,11 +96,18 @@ func readFn(ctx context.Context, filename string, emit 
func(string)) error {
        }
        defer fd.Close()
 
-       scanner := bufio.NewScanner(fd)
-       for scanner.Scan() {
-               emit(scanner.Text())
+       rd := bufio.NewReader(fd)
+       for {
+               line, err := rd.ReadString('\n')

Review comment:
       ack. 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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to