Skip to content

Commit

Permalink
docs: document exposed funtions
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Oct 29, 2024
1 parent 8212bd1 commit 047e7bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions modulegen/internal/workfile/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions modulegen/internal/workfile/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 047e7bb

Please sign in to comment.