aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/copy.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-16 01:38:59 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-16 01:38:59 +0900
commit084cd84f36a1d608541b4aa4e1e95334395d8953 (patch)
treeb48fac0d902627411036630d42edc1ca45057dd1 /internal/app/copy.go
parent430f1a5b4e4e2b164297391390e3a0cbe2ad2eb2 (diff)
app: port app to use the system package
This commit does away with almost all baggage left over from the Ego port. Error wrapping also got simplified. All API changes happens to be internal which means no changes to main except renaming of the BaseError type. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/app/copy.go')
-rw-r--r--internal/app/copy.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/internal/app/copy.go b/internal/app/copy.go
deleted file mode 100644
index bf90bfea..00000000
--- a/internal/app/copy.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package app
-
-import (
- "io"
- "os"
-)
-
-func copyFile(dst, src string) error {
- srcD, err := os.Open(src)
- if err != nil {
- return err
- }
- defer func() {
- if srcD.Close() != nil {
- // unreachable
- panic("src file closed prematurely")
- }
- }()
-
- dstD, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
- if err != nil {
- return err
- }
- defer func() {
- if dstD.Close() != nil {
- // unreachable
- panic("dst file closed prematurely")
- }
- }()
-
- _, err = io.Copy(dstD, srcD)
- return err
-}