sally icon indicating copy to clipboard operation
sally copied to clipboard

Add back go-source tag

Open abhinav opened this issue 2 years ago • 5 comments

pkg.go.dev uses the go-source for VCS hosts that it doesn't recognize. We should add back go-source.

Thanks to @hacdias for reporting:


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.

Originally posted by @hacdias in https://github.com/uber-go/sally/issues/83#issuecomment-1798545716

abhinav avatar Nov 07 '23 18:11 abhinav

Can I do this again haha @abhinav I was the one who removed it

SoulPancake avatar Nov 07 '23 19:11 SoulPancake

Sure, @SoulPancake, go for it!

abhinav avatar Nov 07 '23 19:11 abhinav

@SoulPancake if you're at it, it would be great if you could take this PR into account (#128) and added some field that lets users override the source value via the config. If not, I can always make another PR if that'd be welcomed.

hacdias avatar Nov 07 '23 19:11 hacdias

It seems to me that if we want to support alternative VCSs per #128, we can't hard-code it to GitHub's directory/file path scheme like we did previously. We'll need something like a fileTemplate and a dirTemplate field to allow setting them to arbitrary values per https://github.com/golang/gddo/wiki/Source-Code-Links. Does that sound right to you, @hacdias?

abhinav avatar Nov 10 '23 13:11 abhinav

Yeah, I think so. I would add both variables you mentioned. Only if both are set, add go-source.

By default, I wouldn't set go-source, as chances are most people will be using known VCS services/systems.

hacdias avatar Nov 10 '23 13:11 hacdias