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
cmd/go: go.work library path parsing error causes build failed #54611
Comments
lib.GetSecondTimestamp: func GetSecondTimestamp() int64 { main.go: func main() { go.work: go 1.19 use /Users/work/code/ai/golib // the path is local absolute path when i use The path used in |
@hlbbt, when you invoke You are invoking |
@hlbbt, there is a tutorial on using modules in https://go.dev/doc/tutorial/create-module, and one on workspaces in https://go.dev/doc/tutorial/workspaces. I would suggest working through those as a starting point, and hopefully it will help to clarify how workspaces are intended to be used. Once you've worked through those, please let us know if there are specific steps we can take to better clarify the documentation or error messages. |
@bcmills I seem to understand the concept of workspace, It needs to contain Re-tested, compiled and passed, and also met my work requirements. Very thanks. |
I completely refer to the official example, I think Another question: the local public package is referenced in |
I don't agree that it's unreasonable, and it's how workspaces were designed in the proposal that was approved. If you have a lot of interrelated packages or interrelated programs, consider them putting them together in one larger module instead of stitching together a bunch of smaller ones into a workspace.
It should display whatever version of the function is actually used in your current configuration. If you have |
I have a scene like this: I don't know if there is a better solution for this scenario, or use the |
If you want to modify a package and have all of its consumers see the changes, you will need to either push the changes and update the consumers' |
That said, I don't think the issue tracker is the right forum to continue this discussion. It seems like the |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
main.go
, referenced the online library, and output the timestamp.go build
, build successful.go.work
, reference the local library.go run main.go
and output local changes.go build
, build failed.What did you expect to see?
go work
to compile and pass.go.work
go.work
is an absolute path, why the path will be resolved incorrectly when buildingWhat did you see instead?
build failed
The text was updated successfully, but these errors were encountered: