From 3ce9a6500b555d88b44e6f7ef7dafe4d88c7084b Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 25 Apr 2022 22:41:58 +0200 Subject: [PATCH] fix: go workspace --- module.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module.go b/module.go index 379ae07..c164835 100644 --- a/module.go +++ b/module.go @@ -1,6 +1,7 @@ package gomoddirectives import ( + "bytes" "encoding/json" "errors" "fmt" @@ -29,7 +30,7 @@ func GetModuleFile() (*modfile.File, error) { } var v modInfo - err = json.Unmarshal(raw, &v) + err = json.NewDecoder(bytes.NewBuffer(raw)).Decode(&v) if err != nil { return nil, fmt.Errorf("unmarshaling error: %w: %s", err, string(raw)) }