Hi,

I just enhanced go-testdeep documentation to use the new go 1.19 links & 
list features.

The result is pretty good → 
https://pkg.go.dev/github.com/maxatome/go-testdeep/td

In the post 
https://dev.to/maxatome/large-repo-switched-to-new-go119-doc-comments-4i2m 
I list a few remarks & ideas, I copy below:

It seems that pkg.go.dev hasn't handled [links] in lists yet. I say "yet", 
because the last version of godoc 
<https://pkg.go.dev/golang.org/x/tools/godoc> handles them properly. So I 
suppose it will be fixed soon.

Struct fields links work for standard packages, but not for local/current 
one. For example [http.Cookie.Raw] produces a link to the Raw field of 
Cookie in net/http package (example <https://pkg.go.dev/net/http#Cookie.Raw>), 
but in go-testdeep td 
<https://pkg.go.dev/github.com/maxatome/go-testdeep/td> package 
[ContextConfig.RootName] remains intact and so is not changed into a link, 
even when using the last version of godoc.

Links are not handled in var or const comments when a single keyword groups 
several declarations.

[x] could be a builtin pointing to https://pkg.go.dev/builtin#x, like error 
<https://pkg.go.dev/builtin#error> for example, for all native types, as we 
see them in signatures.

It could be cool to have shortcut reference links global to the package, 
perhaps in the package doc itself. It would avoid to declare in each 
comment the same shortcut again and again.

It can be interesting that the shortcut reference links accept indirect 
URLs. For example, in td 
<https://pkg.go.dev/github.com/maxatome/go-testdeep/td> I often talk about 
Cmp* functions. Each time, I would like to reference Cmp 
<https://pkg.go.dev/github.com/maxatome/go-testdeep/td#Cmp> function (the 
first one of the Cmp* serie). To do it, I have to set the full URL in the 
shortcut:
// [Cmp*]: https://pkg.go.dev/github.com/maxatome/go-testdeep/td#Cmp 

while simply using:
// [Cmp*]: Cmp 

would avoid referencing pkg.go.dev as [Cmp] does elsewhere.

Be that as it may, thanks for the features!

++

Max.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c9035a16-9f9e-46fe-ba0f-e0d6457ef3e6n%40googlegroups.com.

Reply via email to