aboutsummaryrefslogtreecommitdiff
path: root/internal/fetch/getters.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fetch/getters.go')
-rw-r--r--internal/fetch/getters.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/fetch/getters.go b/internal/fetch/getters.go
index f95dada6..89b9fc08 100644
--- a/internal/fetch/getters.go
+++ b/internal/fetch/getters.go
@@ -190,7 +190,7 @@ func (g *directoryModuleGetter) Mod(ctx context.Context, path, version string) (
}
data, err := os.ReadFile(filepath.Join(g.dir, "go.mod"))
if errors.Is(err, os.ErrNotExist) {
- return []byte(fmt.Sprintf("module %s\n", g.modulePath)), nil
+ return fmt.Appendf(nil, "module %s\n", g.modulePath), nil
}
return data, err
}
@@ -433,7 +433,7 @@ func (g *goPackagesModuleGetter) Mod(ctx context.Context, modulePath, version st
}
data, err := os.ReadFile(filepath.Join(m.Dir, "go.mod"))
if errors.Is(err, os.ErrNotExist) {
- return []byte(fmt.Sprintf("module %s\n", modulePath)), nil
+ return fmt.Appendf(nil, "module %s\n", modulePath), nil
}
return data, err
}