gokrazy / tools

this repository contains the gok CLI tool of gokrazy
https://gokrazy.org
BSD 3-Clause "New" or "Revised" License
50 stars 26 forks source link

gok: fix adding module with uppercase letters #53

Closed oliverpool closed 1 year ago

oliverpool commented 1 year ago

It is currently impossible to add a module which contains uppercase:

> gok add github.com/VictoriaMetrics/VictoriaMetrics/app/victoria-metrics
2023/03/25 10:27:37 Adding github.com/VictoriaMetrics/VictoriaMetrics/app/victoria-metrics as a (non-local) package to gokrazy instance couloir
2023/03/25 10:27:37 could not resolve import path "github.com/VictoriaMetrics/VictoriaMetrics/app/victoria-metrics" to any Go module

Because of https://pkg.go.dev/golang.org/x/mod@v0.9.0/module#hdr-Escaped_Paths, the import path must be escaped before making a request to a go proxy.

I also added an escaping of the version (untested, since I don't have any module with such a version at hand.

stapelberg commented 1 year ago

Thanks for sending this fix!