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

go-source tag is no longer necessary #83

Closed
abhinav opened this issue Apr 23, 2023 · 6 comments · Fixed by #92
Closed

go-source tag is no longer necessary #83

abhinav opened this issue Apr 23, 2023 · 6 comments · Fixed by #92

Comments

@abhinav
Copy link
Collaborator

abhinav commented Apr 23, 2023

The package template generates a go-source tag along with the go-import tag.

<meta name="go-import" content="{{ .CanonicalURL }} git https://{{ .Repo }}">
<meta name="go-source" content="{{ .CanonicalURL }} https://{{ .Repo }} https://{{ .Repo }}/tree/{{ .Branch }}{/dir} https://{{ .Repo }}/tree/{{ .Branch }}{/dir}/{file}#L{line}">

The go-import tag is used by the go CLI to find the source code. Details at https://go.dev/ref/mod#vcs-find.

However, go-source is a leftover from pre-Go-module days, in service of godoc.org: https://github.com/golang/gddo/wiki/Source-Code-Links
This is no longer necessary -- pkg.go.dev serves documentation and module-version-aware source links directly.

@sywhang
Copy link
Contributor

sywhang commented Apr 25, 2023

internal ref: GO-2001

@SoulPancake
Copy link
Contributor

Is this good to be removed then? @abhinav @sywhang

@abhinav
Copy link
Collaborator Author

abhinav commented May 6, 2023

@SoulPancake Yes, based on my reading of the Go Modules docs and the godoc.org docs, I believe this should be safe to remove. I'll defer to @sywhang and other maintainers on whether the change is welcome.

@sywhang
Copy link
Contributor

sywhang commented May 6, 2023

@SoulPancake yup! We welcome contributions that'll remove it.

@hacdias
Copy link
Contributor

hacdias commented Nov 7, 2023

Correct me if I'm wrong, but this seems like a regression. pkg.go.dev still uses go-source for unknown VCS systems: https://pkg.go.dev/about#source-links - right now, Sally only supports GitHub, but it'd be great if it were more generic.

@abhinav
Copy link
Collaborator Author

abhinav commented Nov 7, 2023

@hacdias Yeah, that's right. Thanks for pointing this out. We'll revert the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants