From b8c95954f44359b0c924b90b2694c98bf363d10e Mon Sep 17 00:00:00 2001 From: hgouchet Date: Fri, 22 Mar 2019 23:07:44 +0100 Subject: [PATCH 1/2] [twgit] Init hotfix 'hotfix-0.1.1'. From cc35b87c76fbf79d7822524bfd18b999fc5eb4e5 Mon Sep 17 00:00:00 2001 From: hgouchet Date: Fri, 22 Mar 2019 23:11:28 +0100 Subject: [PATCH 2/2] avoid panic on casting nil to string --- README.md | 1 + example/server/main.go | 1 + example/start/start.go | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 7c6efd0..0b5bea9 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ func main() { buf, err := c.ReadAll() if err != nil { c.Error(err) + return } // writes something as response c.String(string(buf)) diff --git a/example/server/main.go b/example/server/main.go index a1b4bd4..7440a41 100644 --- a/example/server/main.go +++ b/example/server/main.go @@ -13,6 +13,7 @@ func main() { body, err := c.ReadAll() if err != nil { c.Error(err) + return } log.Println(string(body)) c.String("read") diff --git a/example/start/start.go b/example/start/start.go index 75a8089..4126f34 100644 --- a/example/start/start.go +++ b/example/start/start.go @@ -15,6 +15,7 @@ func main() { buf, err := c.ReadAll() if err != nil { c.Error(err) + return } // writes something as response c.String(string(buf))