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

Typo in tutorial/call-module-code #44906

Closed
pgalbavy opened this issue Mar 10, 2021 · 7 comments
Closed

Typo in tutorial/call-module-code #44906

pgalbavy opened this issue Mar 10, 2021 · 7 comments

Comments

@pgalbavy
Copy link

pgalbavy commented Mar 10, 2021

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

Tutorial website / go 1.16

Does this issue reproduce with the latest release?

Yes

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

https://golang.org/doc/tutorial/call-module-code ->

https://github.com/golang/website/blob/7e301e09e5c301ad4c225e8e240b6c3a0ba3d138/_content/doc/tutorial/call-module-code.html#L147

(Tested on Windows under VSC Terminal)

What did you do?

Reading, following examples

What did you expect to see?

PS C:\Users\peter\go> go mod edit -replace="example.com/greetings=../greetings"
go: cannot find main module; see 'go help modules'

What did you see instead?

PS C:\Users\peter\go> go mod edit -replace=example.com/greetings=../greetings
go mod: -replace=example: need old[@v]=new[@w] (missing =)

@AlexRouSg
Copy link
Contributor

go mod edit -replace=example.com/greetings=../greetings is a valid command string.
Go's flag parsing allows for -flag=asdf and -flag asdf
You can read it as -replace="example.com/greetings=../greetings"

@pgalbavy
Copy link
Author

pgalbavy commented Mar 10, 2021

Except, if you try it, it doesn't work a per example in tutorial - perhaps adding quotes would also be a suitable fix; This may only break on Windows too.

edited report to point out Windows and update examples to make it clearer, sorry

@AlexRouSg
Copy link
Contributor

Ahh yeah it looks like it's only in power shell, even cmd runs it fine.

@pgalbavy
Copy link
Author

My fault for trying an IDE instead of just vi...

@AlexRouSg
Copy link
Contributor

If you want to contribute the fix please read https://golang.org/doc/contribute

@pgalbavy
Copy link
Author

OK, will try, thanks.

@tmthrgd
Copy link
Contributor

tmthrgd commented Mar 11, 2021

I think this is probably a duplicate of #43179 and an example of the still unfixed PowerShell/PowerShell#6291.

@golang golang locked and limited conversation to collaborators Mar 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants