Issue updating pkg.go.dev

90 views
Skip to first unread message

JeffG

unread,
Nov 12, 2024, 4:12:35 AMNov 12
to golang-nuts
I have a custom url package nspeed.app/nspeed which redirects to github.com/nspeed-app/nspeed (using a meta tag go-import):

<meta name=go-import content="nspeed.app/nspeed git https://github.com/nspeed-app/nspeed>

It was setup a year ago or so with version v0.11.0 and was working fine.
Today I updated some code and the github repo tag to v0.12.0
waited a few days then


but it still fetch the old version.

So I tried to force the update as specified here: https://pkg.go.dev/about#adding-a-package
to update from the pkg web site directly:
first I clicked the "request" button but later the page displays "not found"

then I tried with proxy and 'go get', I get the same error about xml:

go: nspeed.app/nsp...@v0.12.0: unrecognized import path "nspeed.app/nspeed": parsing nspeed.app/nspeed: XML syntax error on line 1: expected /> in element

I am probably missing something or are go-import meta tags not working anymore may be?

JeffG

unread,
Nov 12, 2024, 6:44:23 AMNov 12
to golang-nuts
update: I think I might I found the issue, the bot doesn't seems to follow redirections (at least 301 ones).

Thanks to the option "-x" of go get:

leads to 
which redirects '301) to the same url but with trailing slash:
which has the go-import tag but the bot doesn't seem to follow the redirection.

Is this the expected behavior of the bot?

Sean Liao

unread,
Nov 12, 2024, 11:19:14 AMNov 12
to golang-nuts
No, it;s a bug similar to https://github.com/prettier/prettier/issues/8210

`go` follows the redirects, but there are several elements in your
html that cause parsing issues (unquoted attribute values containing
`/`).

> <link rel=apple-touch-icon sizes=180x180 href=/apple-touch-icon.png>
> <link rel=icon type=image/png sizes=32x32 href=/favicon-32x32.png>
> <link rel=icon type=image/png sizes=16x16 href=/favicon-16x16.png>
> <link rel=manifest href=/site.webmanifest>
> <link rel=mask-icon href=/safari-pinned-tab.svg color>
> <link rel="shortcut icon" href=/favicon.ico>

See https://go.dev/play/p/XOe6Z1czYWe
go parser https://go.googlesource.com/go/+/c96939fbed3d60159dc81ee9ad591de8cfd41168/src/cmd/go/internal/vcs/discovery.go#31

- sean
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/3ed8d706-4f8e-44ac-a9f2-bfef6351954en%40googlegroups.com.

JeffG

unread,
Nov 12, 2024, 12:07:11 PMNov 12
to golang-nuts
Much thanks for finding the issue !

The site is generated by Hugo, I'll try to fix the template.



JeffG

unread,
Nov 12, 2024, 1:32:34 PMNov 12
to golang-nuts
Upon more investigation, the issue was already reported in 2020: https://github.com/golang/go/issues/39748 but never fixed

There is a workaround with Hugo to prevent minification from removing quotes.
Add this to hugo conf file:

minify:
  tdewolff:
    html:
      keepQuotes: true

Reply all
Reply to author
Forward
0 new messages