From 084cd84f36a1d608541b4aa4e1e95334395d8953 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Wed, 16 Oct 2024 01:38:59 +0900 Subject: 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 --- internal/app/copy.go | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 internal/app/copy.go (limited to 'internal/app/copy.go') 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 -} -- cgit v1.3.1