[ https://issues.apache.org/jira/browse/ARROW-9463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated ARROW-9463: ---------------------------------- Labels: pull-request-available (was: ) > [Go] The writer is double closed in TestReadWrite > ------------------------------------------------- > > Key: ARROW-9463 > URL: https://issues.apache.org/jira/browse/ARROW-9463 > Project: Apache Arrow > Issue Type: Test > Components: Go > Affects Versions: 0.17.1 > Reporter: FredGan > Priority: Minor > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > The writer in the test case 'TestReadWrite' is double closed. > {code:java} > 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) > } > {code} > The 'defer w.Close()' is redundant, which makes one more ']}' in the end of > the output json file . > > -- This message was sent by Atlassian Jira (v8.3.4#803005)