File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -418,12 +418,14 @@ func TestUnzip(t *testing.T) {
418418 if err != nil {
419419 t .Fatalf ("failed to open zip file: %v" , err )
420420 }
421+ defer f .Close () // Ensure file is closed
421422 zipWriter := zip .NewWriter (f )
422423 if _ , err := zipWriter .Create ("file.txt" ); err != nil {
423424 t .Fatalf ("failed to create file in zip: %v" , err )
424425 }
425- zipWriter .Close ()
426- f .Close ()
426+ if err := zipWriter .Close (); err != nil { // Check for errors on close
427+ t .Fatalf ("failed to close zip writer: %v" , err )
428+ }
427429
428430 // Make the output directory read-only.
429431 readOnlyDir := filepath .Join (e .tmpDir , "readonly" )
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ if [ ! -d "$LIBRARIANGEN_GOOGLEAPIS_DIR" ]; then
8383 exit 1
8484fi
8585echo " Using googleapis source from $LIBRARIANGEN_GOOGLEAPIS_DIR "
86- SOURCE_DIR=$( readlink -f " $LIBRARIANGEN_GOOGLEAPIS_DIR " )
86+ SOURCE_DIR=$( cd " $LIBRARIANGEN_GOOGLEAPIS_DIR " && pwd )
8787
8888# Copy the generate-request.json into the librarian directory.
8989cp " testdata/generate/librarian/generate-request.json" " $LIBRARIAN_DIR /"
You can’t perform that action at this time.
0 commit comments