Skip to content

Commit

Permalink
go/sppark.go: resolve lint warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-asm committed Jul 30, 2024
1 parent 27e811c commit 9e9cb9a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions go/sppark.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright Supranational LLC
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

package sppark

// #cgo linux LDFLAGS: -ldl -Wl,-rpath,"$ORIGIN"
Expand All @@ -12,7 +16,6 @@ package sppark
// }
// #else
// # include <dlfcn.h>
// # include <errno.h>
// #endif
// #include <string.h>
// #include <stdlib.h>
Expand Down Expand Up @@ -323,8 +326,13 @@ func Exfiltrate(optional ...string) error {
return err
}
log.Print("copying ", file)
io.Copy(fout, finp)
written, err := io.Copy(fout, finp)
fout.Close()
if err != nil {
finp.Close()
return err
}
log.Printf("copied %d bytes", written)
}
finp.Close()
}
Expand Down

0 comments on commit 9e9cb9a

Please sign in to comment.