lib9p

Go 9P library.
Log | Files | Refs

commit e499ddaa1eb33172168d3d75a4e26e06e9db122d
parent ba9df889ba19e9329d7ca218a8fc76fc619143bb
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Wed,  6 Sep 2023 10:18:17 +0900

spell it with an "e"

Diffstat:
Mfcall.go | 24++++++++++++------------
Mparse.go | 2+-
2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fcall.go b/fcall.go @@ -718,7 +718,7 @@ func (msg *ROpen) String() string { msg.Tag(), msg.Qid(), msg.IoUnit()) } -type TCreat struct { +type TCreate struct { tag uint16 fid uint32 name string @@ -726,8 +726,8 @@ type TCreat struct { mode OpenMode } -func newTCreat(buf []byte) *TCreat { - msg := new(TCreat) +func newTCreate(buf []byte) *TCreate { + msg := new(TCreate) cur := 5 msg.tag = gbit16(buf[cur : cur+2]) cur += 2 @@ -747,16 +747,16 @@ func newTCreat(buf []byte) *TCreat { return msg } -func (msg *TCreat) Size() uint32 { +func (msg *TCreate) Size() uint32 { return uint32(4 + 1 + 2 + 4 + 2 + len(msg.name) + 4 + 1) } -func (msg *TCreat) Type() MsgType { return Tcreate } -func (msg *TCreat) Tag() uint16 { return msg.tag } -func (msg *TCreat) Fid() uint32 { return msg.fid } -func (msg *TCreat) Name() string { return msg.name } -func (msg *TCreat) Perm() FileMode { return msg.perm } -func (msg *TCreat) Mode() OpenMode { return msg.mode } -func (msg *TCreat) marshal() []byte { +func (msg *TCreate) Type() MsgType { return Tcreate } +func (msg *TCreate) Tag() uint16 { return msg.tag } +func (msg *TCreate) Fid() uint32 { return msg.fid } +func (msg *TCreate) Name() string { return msg.name } +func (msg *TCreate) Perm() FileMode { return msg.perm } +func (msg *TCreate) Mode() OpenMode { return msg.mode } +func (msg *TCreate) marshal() []byte { cur := 0 buf := make([]byte, msg.Size()) pbit32(buf[cur:cur+4], msg.Size()) @@ -785,7 +785,7 @@ func (msg *TCreat) marshal() []byte { return buf } -func (msg *TCreat) String() string { +func (msg *TCreate) String() string { return fmt.Sprintf("Tcreate tag %d fid %d name %s perm %v mode %v", msg.Tag(), msg.Fid(), msg.Perm().PermString(), msg.Mode()) } diff --git a/parse.go b/parse.go @@ -62,7 +62,7 @@ func unmarshal(buf []byte) (Msg, error) { case Ropen: return newROpen(buf), nil case Tcreate: - return newTCreat(buf), nil + return newTCreate(buf), nil case Rcreate: return newRCreate(buf), nil case Tread: