Skip to content

Commit

Permalink
Revert "x/playground: remove -mod=mod and execute go mod tidy before …
Browse files Browse the repository at this point in the history
…command"

This reverts CL 458895.

Reason for revert: Broke the playground with "no space left on device".

Change-Id: I0ae0a8489446bd66b49196dce64ee79de6f85486
Reviewed-on: https://go-review.googlesource.com/c/playground/+/560460
Commit-Queue: Robert Findley <[email protected]>
Run-TryBot: Robert Findley <[email protected]>
Auto-Submit: Robert Findley <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
  • Loading branch information
findleyr authored and gopherbot committed Feb 2, 2024
1 parent 731d161 commit f4dce0b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 79 deletions.
36 changes: 0 additions & 36 deletions mod.go

This file was deleted.

7 changes: 1 addition & 6 deletions sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ func sandboxBuild(ctx context.Context, tmpDir string, in []byte, vet bool) (br *
// Create a GOPATH just for modules to be downloaded
// into GOPATH/pkg/mod.
cmd.Args = append(cmd.Args, "-modcacherw")
cmd.Args = append(cmd.Args, "-mod=mod")
br.goPath, err = os.MkdirTemp("", "gopath")
if err != nil {
log.Printf("error creating temp directory: %v", err)
Expand All @@ -471,12 +472,6 @@ func sandboxBuild(ctx context.Context, tmpDir string, in []byte, vet bool) (br *
out := &bytes.Buffer{}
cmd.Stderr, cmd.Stdout = out, out

// Run "go mod tidy" before executing a command.
_, err = modTidy(ctx, tmpDir, br.goPath)
if err != nil {
return nil, fmt.Errorf("error running go mod tidy: %v", err)
}

if err := cmd.Start(); err != nil {
return nil, fmt.Errorf("error starting go build: %v", err)
}
Expand Down
36 changes: 0 additions & 36 deletions tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,40 +633,4 @@ func print() {
`, errors: `./foo.go:6:2: syntax error: unexpected =, expecting }
`,
},
{
name: "workspace",
prog: `
package main
import "internal/bar"
func main() {
bar.Print()
}
-- go.work --
go 1.18
use (
.
./projects/bar
)
-- go.mod --
module internal/foo
go 1.18
require internal/bar v0.0.0
-- projects/bar/go.mod --
module internal/bar
go 1.18
-- projects/bar/upper.go --
package bar
import "fmt"
func Print() {
fmt.Println("bar")
}
`, want: "bar\n"},
}
2 changes: 1 addition & 1 deletion vet.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func vetCheckInDir(ctx context.Context, dir, goPath string) (output string, exec
mGoVetLatency.M(float64(time.Since(start))/float64(time.Millisecond)))
}()

cmd := exec.Command("go", "vet", "--tags=faketime")
cmd := exec.Command("go", "vet", "--tags=faketime", "--mod=mod")
cmd.Dir = dir
// Linux go binary is not built with CGO_ENABLED=0.
// Prevent vet to compile packages in cgo mode.
Expand Down

0 comments on commit f4dce0b

Please sign in to comment.