golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
120.09k stars 17.24k forks source link

go: errors parsing go.mod #66961

Open aliihsankamil opened 3 weeks ago

aliihsankamil commented 3 weeks ago

Go version

go version go1.22.0 windows/amd64

Output of go env in your module/workspace:

module blueprint-example

go 1.22.0

replace geometry-lib => D:/DATA ALI/2 DOKUMEN\PELATIHAN/Enigma Camp/Golang/GOLANG DATABASE/geometry-lib

What did you do?

go: errors parsing go.mod: go.mod:5: usage: replace module/path [v1.2.3] => other/module v1.4 or replace module/path [v1.2.3] => ../local/directory

What did you see happen?

Why?

What did you expect to see?

I want to replace module

seankhliao commented 3 weeks ago

I believe the file separator is \ on windows. Is 2 DOKUMEN\PELATIHAN a literal string with a \ or 2 directories?

aliihsankamil commented 3 weeks ago

ouh thankyou, but when i change i have error to

go101 commented 3 weeks ago

the replace local path should start with ./ or ../. Don't use absolute paths.

And try not to use path with space chars. (I'm not sure, you can try it).