lib9p

Go 9P library.
Log | Files | Refs | LICENSE

commit c6ecdf66f6a41aa98dcb8c513a223ec078c22b77
parent b7719d8a5e561508c673b484c530428dd745a9fb
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Thu, 11 Jan 2024 08:10:11 +0900

gofmt

Diffstat:
Mfid.go | 2+-
Mfs.go | 2+-
Mserver.go | 10+++++-----
Mserver_test.go | 2+-
4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fid.go b/fid.go @@ -26,7 +26,7 @@ const ( // O_APPEND, O_CREATE, O_EXCL, O_SYNC can't be specified. func ModeToFlag(m OpenMode) int { var flag int - switch m&3 { + switch m & 3 { case OREAD, OEXEC: flag = O_RDONLY case OWRITE: diff --git a/fs.go b/fs.go @@ -26,7 +26,7 @@ const ( O_RDWR int = os.O_RDWR // open the file read-write. // The remaining values may be or'ed in to control behavior. O_APPEND int = os.O_APPEND // append data to the file when writing. - O_CREATE int = os.O_CREATE // create a new file if none exists. + O_CREATE int = os.O_CREATE // create a new file if none exists. O_EXCL int = os.O_EXCL // used with O_CREATE, file must not exist. O_SYNC int = os.O_SYNC // open for synchronous I/O. O_TRUNC int = os.O_TRUNC // truncate regular writable file when opened. diff --git a/server.go b/server.go @@ -494,10 +494,10 @@ func sOpen(ctx context.Context, c *conn, rc <-chan *request) { return } var ( - p fs.FileMode - err error - qid Qid - fi fs.FileInfo + p fs.FileMode + err error + qid Qid + fi fs.FileInfo ) ifcall := r.ifcall.(*TOpen) r.fid, ok = c.fPool.lookup(ifcall.Fid) @@ -730,7 +730,7 @@ func sRead(ctx context.Context, c *conn, rc <-chan *request) { r.err = fmt.Errorf("stat: %v", err) goto resp } - if c.mSize() - IOHDRSZ < ifcall.Count { + if c.mSize()-IOHDRSZ < ifcall.Count { ifcall.Count = c.mSize() - IOHDRSZ } data = make([]byte, ifcall.Count) diff --git a/server_test.go b/server_test.go @@ -729,7 +729,7 @@ func TestORCLOSE(t *testing.T) { fid.fs = testfs fid.uid = "glenda" tc0 <- &request{ - ifcall: &TCreate{Fid: 0, Name: "tmp", Perm: 0777, Mode: ORCLOSE|OREAD}, + ifcall: &TCreate{Fid: 0, Name: "tmp", Perm: 0777, Mode: ORCLOSE | OREAD}, } ofcall := (<-rc).ofcall if rerr, ok := ofcall.(*RError); ok {