Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/website: ref/mod still references the deleted -workfile flag #51838

Closed
MatthewJamesBoyle opened this issue Mar 21, 2022 · 4 comments
Closed
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@MatthewJamesBoyle
Copy link

What version of Go are you using (go version)?

go version go1.18 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/matthewboyle/Library/Caches/go-build"
GOENV="/Users/matthewboyle/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/matthewboyle/go/pkg/mod"
GONOPROXY="github.com/moonr-app"
GONOSUMDB="github.com/moonr-app"
GOOS="darwin"
GOPATH="/Users/matthewboyle/go"
GOPRIVATE="github.com/moonr-app"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/matthewboyle/go/go1.18"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/matthewboyle/go/go1.18/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/matthewboyle/Dev/moonr/test1.18/go.mod"
GOWORK="/Users/matthewboyle/Dev/moonr/test1.18/go.work"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6c/565l_36j5f93vczwq09z9_100000gn/T/go-build836227308=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I am trying to test go workspaces. I have created a really simple project with the following file tree:
image

go.mod looks as follows:

module test1.18

go 1.18

require golang.org/x/sync v0.0.0-20210220032951-036812b2e83c

go.work:

go 1.18

use ./local/sync

and main.go

package main

import (
	"log"

	"golang.org/x/sync/errgroup"
)

func main() {
	var eg errgroup.Group

	eg.Go(func() error {
		log.Println("did a thing")
		return nil
	})

	if err := eg.Wait(); err != nil {
		log.Println("err")
	}
}

What did you expect to see?

I run go run ./workspace/main.go and it works great. It uses workspace mode and replaces the sync module. However, I am trying to run go run -workfile=off ./workspace/main.go and I get the following error:

flag provided but not defined: -workfile

What did you see instead?

I would expect my program to run without using my go.work file.

I got round this by running the following instead:

GOWORK=off go run ./workspace/main.go

which worked correctly.

@mvdan
Copy link
Member

mvdan commented Mar 21, 2022

See 5d8d387. The -workfile flag was removed before the final Go 1.18 release.

@mvdan mvdan closed this as completed Mar 21, 2022
@MatthewJamesBoyle
Copy link
Author

Thanks for the prompt reply. The documentation for workspace: https://go.dev/ref/mod#workspaces references a -workfile flag so it needs to be updated :)

@mvdan
Copy link
Member

mvdan commented Mar 21, 2022

Ah, thank you. I see they updated https://go.dev/doc/go1.18 but forgot to update the website docs :) Reopening. cc @matloob @bcmills

@mvdan mvdan reopened this Mar 21, 2022
@mvdan mvdan changed the title affected/package: go workspace x/website: ref/mod still references the deleted -workfile flag Mar 21, 2022
@mvdan mvdan added NeedsFix The path to resolution is known, but the work has not been done. modules labels Mar 21, 2022
@gopherbot gopherbot added this to the Unreleased milestone Mar 21, 2022
@seankhliao
Copy link
Member

Fixed in CL 393360

@golang golang locked and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants