mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 17:20:50 +00:00
config/yaml: s/bytes.NewBuffer/bytes.NewReader/
When io.Reader is required out of []byte, it's better to use bytes.NewReader than bytes.NewBuffer. Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
This commit is contained in:
parent
3224369ac9
commit
c998e52cc0
@ -97,7 +97,7 @@ func parseYML(buf []byte) (cnf map[string]interface{}, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
data, err := goyaml2.Read(bytes.NewBuffer(buf))
|
||||
data, err := goyaml2.Read(bytes.NewReader(buf))
|
||||
if err != nil {
|
||||
log.Println("Goyaml2 ERR>", string(buf), err)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user