From 047e7bb3f3e8689cc8ee7b6f2bec80240a2f7891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 29 Oct 2024 11:18:18 +0100 Subject: [PATCH] docs: document exposed funtions --- modulegen/internal/workfile/reader.go | 1 + modulegen/internal/workfile/writer.go | 1 + 2 files changed, 2 insertions(+) diff --git a/modulegen/internal/workfile/reader.go b/modulegen/internal/workfile/reader.go index 088bf00ef7..e72d0f2367 100644 --- a/modulegen/internal/workfile/reader.go +++ b/modulegen/internal/workfile/reader.go @@ -7,6 +7,7 @@ import ( "golang.org/x/mod/modfile" ) +// Read reads the go.work file from the given path func Read(workFilePath string) (*modfile.WorkFile, error) { file, err := os.ReadFile(workFilePath) if err != nil { diff --git a/modulegen/internal/workfile/writer.go b/modulegen/internal/workfile/writer.go index 634ff72450..b353e24086 100644 --- a/modulegen/internal/workfile/writer.go +++ b/modulegen/internal/workfile/writer.go @@ -8,6 +8,7 @@ import ( "golang.org/x/mod/modfile" ) +// Write writes the given go.work to the given path func Write(workFilePath string, file *modfile.WorkFile) error { err := os.MkdirAll(filepath.Dir(workFilePath), 0o755) if err != nil {