all: apply godoc [Name] link conventions across comments
Every Go-identifier reference in // and /* */ comments now uses
godoc's [Name] linking syntax so pkg.go.dev and `go doc` render
them as clickable cross-references. No behaviour change.
Pattern applied across the tree:
In-package [Foo], [Foo.Bar]
Cross-package [pkg.Foo], [pkg.Foo.Bar]
Stdlib [netip.Prefix], [errors.Is], [context.Context]
Tailscale [tailcfg.MapResponse], [tailcfg.Node.CapMap],
[tailcfg.NodeAttrSuggestExitNode]
Skip rules:
- File:line refs left as plain text
- HuJSON wire keys inside backtick raw strings untouched
- ACL/policy syntax tokens (tag:foo, autogroup:self, ...) not Go
symbols, left as plain text
- JSON/OIDC wire keys, gorm tags, RFC IPv6 placeholders, markdown
link tags, decorative dividers — all left as-is
This commit is contained in:
parent
17236fd284
commit
4cca63155d
124 changed files with 1037 additions and 1011 deletions
|
|
@ -31,8 +31,8 @@ var (
|
|||
//
|
||||
// Brackets are only accepted around IPv6 addresses, not IPv4, hostnames, or other alias types.
|
||||
// Bracket stripping reduces both forms to bare "addr:port" or "addr/prefix:port",
|
||||
// which the normal LastIndex(":") split handles correctly because port strings
|
||||
// never contain colons.
|
||||
// which the normal [strings.LastIndex] of ":" split handles correctly because
|
||||
// port strings never contain colons.
|
||||
func splitDestinationAndPort(input string) (string, string, error) {
|
||||
// Handle RFC 3986 bracketed IPv6 (e.g. "[::1]:80" or "[fd7a::1]/128:80,443").
|
||||
// Strip brackets after validation and fall through to normal parsing.
|
||||
|
|
@ -82,7 +82,7 @@ func splitDestinationAndPort(input string) (string, string, error) {
|
|||
return destination, port, nil
|
||||
}
|
||||
|
||||
// parsePortRange parses a port definition string and returns a slice of PortRange structs.
|
||||
// parsePortRange parses a port definition string and returns a slice of [tailcfg.PortRange] structs.
|
||||
func parsePortRange(portDef string) ([]tailcfg.PortRange, error) {
|
||||
if portDef == "*" {
|
||||
return []tailcfg.PortRange{tailcfg.PortRangeAny}, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue