mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
parser/metadecoders: Simplify nil check in Unmarshal
This commit is contained in:
@@ -112,7 +112,7 @@ func (d Decoder) UnmarshalStringTo(data string, typ any) (any, error) {
|
||||
// Unmarshal will unmarshall data in format f into an interface{}.
|
||||
// This is what's needed for Hugo's /data handling.
|
||||
func (d Decoder) Unmarshal(data []byte, f Format) (any, error) {
|
||||
if data == nil || len(data) == 0 {
|
||||
if len(data) == 0 {
|
||||
switch f {
|
||||
case CSV:
|
||||
return make([][]string, 0), nil
|
||||
|
Reference in New Issue
Block a user