mirror of
https://git.sr.ht/~rjarry/aerc
synced 2025-02-22 23:23:57 +01:00

Avoid importing code from worker/lib into lib. It should only be the other way around. Move the message parsing code used by maildir, notmuch, mbox and the eml viewer into a lib/rfc822 package. Adapt imports accordingly. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Koni Marti <koni.marti@gmail.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Tested-by: Inwit <inwit@sindominio.net>
15 lines
294 B
Go
15 lines
294 B
Go
package lib
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
// FileSize returns the size of the file specified by name
|
|
func FileSize(name string) (uint32, error) {
|
|
fileInfo, err := os.Stat(name)
|
|
if err != nil {
|
|
return 0, fmt.Errorf("failed to obtain fileinfo: %w", err)
|
|
}
|
|
return uint32(fileInfo.Size()), nil
|
|
}
|