Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-9463

[Go] The writer is double closed in TestReadWrite

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.17.1
    • 2.0.0
    • Go

    Description

      The writer in the test case 'TestReadWrite' is double closed.

      w, err := NewWriter(f, recs[0].Schema())
      if err != nil {
         t.Fatal(err)
      }
      defer w.Close()     // <= Here
      
      for i, rec := range recs {
         err = w.Write(rec)
         if err != nil {
            t.Fatalf("could not write record[%d] to JSON: %v", i, err)
         }
      }
      
      err = w.Close()    // <= Here
      if err != nil {
         t.Fatalf("could not close JSON writer: %v", err)
      }
      

      The 'defer w.Close()' is redundant, which makes one more ']}' in the end of the output json file .

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fredgan FredGan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h