Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Use go mod for fix #1241

Merged
merged 4 commits into from
Aug 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions buffalo/cmd/fix/dep.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ import (
"golang.org/x/sync/errgroup"
)

func modGetUpdate(r *Runner) error {
cmd := exec.Command(envy.Get("GO_BIN", "go"), "get", "-u")
cmd.Stdin = os.Stdin
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
return cmd.Run()
}

func goGetUpdate(r *Runner) error {
fmt.Println("~~~ Running go get ~~~")
ctx, cancel := context.WithCancel(context.Background())
Expand Down Expand Up @@ -55,6 +63,9 @@ var upkg = []string{
// DepEnsure runs `dep ensure -v` to make sure that any newly changed
// imports are added to dep.
func DepEnsure(r *Runner) error {
if !r.App.WithModules {
return modGetUpdate(r)
}
if !r.App.WithDep {
return goGetUpdate(r)
}
Expand Down