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

More reliable fix for Go 1.16 build issues #2119

Merged
merged 2 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions genny/build/apkg.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package build

import (
"os/exec"

"github.com/gobuffalo/genny/v2"
)

Expand All @@ -13,10 +15,15 @@ func apkg(opts *Options) (*genny.Generator, error) {

g.RunFn(copyInflections)
g.RunFn(copyDatabase)
g.RunFn(addDependencies)

return g, nil
}

func addDependencies(r *genny.Runner) error {
return r.Exec(exec.Command("go", "get", "-d"))
}

func copyDatabase(r *genny.Runner) error {
defer func() {
r.Disk.Remove("database.yml")
Expand Down
8 changes: 0 additions & 8 deletions genny/build/build-packr.go

This file was deleted.

4 changes: 2 additions & 2 deletions genny/build/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func Test_New(t *testing.T) {
// we should never leave any files modified or dropped
r.Len(res.Files, 0)

cmds := []string{"go build -tags bar -o bin/foo", "go mod tidy"}
cmds := []string{"go get -d", "go build -tags bar -o bin/foo", "go mod tidy"}
r.Len(res.Commands, len(cmds))
for i, c := range res.Commands {
eq(r, cmds[i], c)
Expand Down Expand Up @@ -84,7 +84,7 @@ func Test_NewWithoutBuildDeps(t *testing.T) {

res := run.Results()

cmds := []string{"go build -tags bar -o bin/foo"}
cmds := []string{"go get -d", "go build -tags bar -o bin/foo"}
r.Len(res.Commands, len(cmds))
for i, c := range res.Commands {
eq(r, cmds[i], c)
Expand Down