From 1307e2b50f6a9c75b8b175117e59c08f5e1ebede Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 12 Apr 2021 16:44:47 +0300 Subject: [PATCH] dont fail empty payload Signed-off-by: Vasiliy Tolstov --- toml.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toml.go b/toml.go index 54bcad5..fbfb4fe 100644 --- a/toml.go +++ b/toml.go @@ -64,6 +64,8 @@ func (c *tomlCodec) ReadBody(conn io.Reader, b interface{}) error { buf, err := ioutil.ReadAll(conn) if err != nil { return err + } else if buf == nil { + return nil } return toml.Unmarshal(buf, b)