Skip to content

Commit

Permalink
Merge pull request #37 from xushiwei/q
Browse files Browse the repository at this point in the history
GOPMOD, GOMOD
  • Loading branch information
xushiwei authored Jan 7, 2024
2 parents 8c1e843 + a2b92f6 commit a059565
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,17 @@ func FindGoMod(dirFrom string) (dir, file string, err error) {
return
}

func GOMOD(dirFrom string) (file string, err error) {
_, file, err = FindGoMod(dirFrom)
return
}

func GOPMOD(dirFrom string) (file string, err error) {
dir, _, err := FindGoMod(dirFrom)
if err != nil {
return
}
return filepath.Join(dir, "gop.mod"), nil
}

// -----------------------------------------------------------------------------

0 comments on commit a059565

Please sign in to comment.