From b626ea8beb4bc1eef134a990eb1a7361c1c126b1 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 13 Jan 2025 14:12:37 +0800 Subject: Reformat code --- misc/open_file.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'misc') diff --git a/misc/open_file.go b/misc/open_file.go index ec5d402..945d78b 100644 --- a/misc/open_file.go +++ b/misc/open_file.go @@ -1,20 +1,20 @@ package misc import ( - "os" "errors" + "os" + "path" "strings" "syscall" - "path" ) type Dir_t struct { - fd int + fd int name string } var ( - Err_illegal_filename = errors.New("illegal filename") + Err_illegal_filename = errors.New("illegal filename") Err_invalid_file_descriptor = errors.New("invalid file descriptor") ) @@ -29,9 +29,9 @@ func Open_file_at(dir Dir_t, filename string, flags int, perms os.FileMode) (*os // Open a file at or beneath the given directory. func Open_file_beneath(dir Dir_t, filename string, flags int, perms os.FileMode) (*os.File, error) { fd, err := Openat2(dir.fd, filename, &Open_how_t{ - Flags: uint64(flags)|syscall.O_CLOEXEC, - Mode: uint64(syscallMode(perms)), - Resolve: RESOLVE_BENEATH|RESOLVE_NO_SYMLINKS, + Flags: uint64(flags) | syscall.O_CLOEXEC, + Mode: uint64(syscallMode(perms)), + Resolve: RESOLVE_BENEATH | RESOLVE_NO_SYMLINKS, }) if err != nil { return nil, err -- cgit v1.2.3