diff --git a/gee-rpc/day1-codec/codec/gob.go b/gee-rpc/day1-codec/codec/gob.go index e4b2a67..d9ef2e6 100644 --- a/gee-rpc/day1-codec/codec/gob.go +++ b/gee-rpc/day1-codec/codec/gob.go @@ -41,15 +41,15 @@ func (c *GobCodec) Write(h *Header, body interface{}) (err error) { _ = c.Close() } }() - if err := c.enc.Encode(h); err != nil { - log.Println("rpc codec: gob error encoding header:", err) - return err + if err = c.enc.Encode(h); err != nil { + log.Println("rpc: gob error encoding header:", err) + return } - if err := c.enc.Encode(body); err != nil { - log.Println("rpc codec: gob error encoding body:", err) - return err + if err = c.enc.Encode(body); err != nil { + log.Println("rpc: gob error encoding body:", err) + return } - return nil + return } func (c *GobCodec) Close() error { diff --git a/gee-rpc/day2-client/codec/gob.go b/gee-rpc/day2-client/codec/gob.go index e4b2a67..d9ef2e6 100644 --- a/gee-rpc/day2-client/codec/gob.go +++ b/gee-rpc/day2-client/codec/gob.go @@ -41,15 +41,15 @@ func (c *GobCodec) Write(h *Header, body interface{}) (err error) { _ = c.Close() } }() - if err := c.enc.Encode(h); err != nil { - log.Println("rpc codec: gob error encoding header:", err) - return err + if err = c.enc.Encode(h); err != nil { + log.Println("rpc: gob error encoding header:", err) + return } - if err := c.enc.Encode(body); err != nil { - log.Println("rpc codec: gob error encoding body:", err) - return err + if err = c.enc.Encode(body); err != nil { + log.Println("rpc: gob error encoding body:", err) + return } - return nil + return } func (c *GobCodec) Close() error { diff --git a/gee-rpc/day3-service/codec/gob.go b/gee-rpc/day3-service/codec/gob.go index 808d97b..d9ef2e6 100644 --- a/gee-rpc/day3-service/codec/gob.go +++ b/gee-rpc/day3-service/codec/gob.go @@ -41,15 +41,15 @@ func (c *GobCodec) Write(h *Header, body interface{}) (err error) { _ = c.Close() } }() - if err := c.enc.Encode(h); err != nil { + if err = c.enc.Encode(h); err != nil { log.Println("rpc: gob error encoding header:", err) - return err + return } - if err := c.enc.Encode(body); err != nil { + if err = c.enc.Encode(body); err != nil { log.Println("rpc: gob error encoding body:", err) - return err + return } - return nil + return } func (c *GobCodec) Close() error { diff --git a/gee-rpc/day4-timeout/codec/gob.go b/gee-rpc/day4-timeout/codec/gob.go index 808d97b..d9ef2e6 100644 --- a/gee-rpc/day4-timeout/codec/gob.go +++ b/gee-rpc/day4-timeout/codec/gob.go @@ -41,15 +41,15 @@ func (c *GobCodec) Write(h *Header, body interface{}) (err error) { _ = c.Close() } }() - if err := c.enc.Encode(h); err != nil { + if err = c.enc.Encode(h); err != nil { log.Println("rpc: gob error encoding header:", err) - return err + return } - if err := c.enc.Encode(body); err != nil { + if err = c.enc.Encode(body); err != nil { log.Println("rpc: gob error encoding body:", err) - return err + return } - return nil + return } func (c *GobCodec) Close() error { diff --git a/gee-rpc/day5-http-debug/codec/gob.go b/gee-rpc/day5-http-debug/codec/gob.go index 808d97b..d9ef2e6 100644 --- a/gee-rpc/day5-http-debug/codec/gob.go +++ b/gee-rpc/day5-http-debug/codec/gob.go @@ -41,15 +41,15 @@ func (c *GobCodec) Write(h *Header, body interface{}) (err error) { _ = c.Close() } }() - if err := c.enc.Encode(h); err != nil { + if err = c.enc.Encode(h); err != nil { log.Println("rpc: gob error encoding header:", err) - return err + return } - if err := c.enc.Encode(body); err != nil { + if err = c.enc.Encode(body); err != nil { log.Println("rpc: gob error encoding body:", err) - return err + return } - return nil + return } func (c *GobCodec) Close() error { diff --git a/gee-rpc/day6-load-balance/codec/gob.go b/gee-rpc/day6-load-balance/codec/gob.go index 808d97b..d9ef2e6 100644 --- a/gee-rpc/day6-load-balance/codec/gob.go +++ b/gee-rpc/day6-load-balance/codec/gob.go @@ -41,15 +41,15 @@ func (c *GobCodec) Write(h *Header, body interface{}) (err error) { _ = c.Close() } }() - if err := c.enc.Encode(h); err != nil { + if err = c.enc.Encode(h); err != nil { log.Println("rpc: gob error encoding header:", err) - return err + return } - if err := c.enc.Encode(body); err != nil { + if err = c.enc.Encode(body); err != nil { log.Println("rpc: gob error encoding body:", err) - return err + return } - return nil + return } func (c *GobCodec) Close() error { diff --git a/gee-rpc/day7-registry/codec/gob.go b/gee-rpc/day7-registry/codec/gob.go index 808d97b..d9ef2e6 100644 --- a/gee-rpc/day7-registry/codec/gob.go +++ b/gee-rpc/day7-registry/codec/gob.go @@ -41,15 +41,15 @@ func (c *GobCodec) Write(h *Header, body interface{}) (err error) { _ = c.Close() } }() - if err := c.enc.Encode(h); err != nil { + if err = c.enc.Encode(h); err != nil { log.Println("rpc: gob error encoding header:", err) - return err + return } - if err := c.enc.Encode(body); err != nil { + if err = c.enc.Encode(body); err != nil { log.Println("rpc: gob error encoding body:", err) - return err + return } - return nil + return } func (c *GobCodec) Close() error {