Skip to content

Relax acceptable XS-Go-Import-Path syntax#305

Open
rhansen wants to merge 2 commits intoDebian:masterfrom
rhansen:go-import-path-syntax
Open

Relax acceptable XS-Go-Import-Path syntax#305
rhansen wants to merge 2 commits intoDebian:masterfrom
rhansen:go-import-path-syntax

Conversation

@rhansen
Copy link
Contributor

@rhansen rhansen commented Feb 25, 2026

This PR relaxes how XS-Go-Import-Path values are parsed to improve maintainer friendliness:

  • Filter out empty string values in XS-Go-Import-Path (in particular, ignore a trailing comma).
  • Allow values to be separated by spaces and/or commas.

Explicitly allow maintainers to add a trailing comma for VC-friendly
multiline values:

    XS-Go-Import-Path:
     example.com/foo,
     example.com/bar,

Currently all code that consumes the map returned from
`getGolangBinaries` ignores the empty string entry, so this commit
should not change behavior at all.  However, this commit improves
readability by making it easy to see what happens in this corner case;
developers don't need to look at every caller of `getGolangBinaries`
to see how the empty string entry is handled.  It is also defensive;
it avoids surprises for any future consumers of `getGolangBinaries`.
For example:

    XS-Go-Import-Path:
     example.com/foo
     example.com/bar

This avoids forcing package maintainers to look up whether a trailing
comma after the final item is allowed or not.  (Separating by
whitespace or permitting a trailing comma makes it easier to construct
a readable and VC-friendly multiline list of values.)  Spaces cannot
exist in a module path, so there is no risk of parsing ambiguity.

The make subcommand doesn't produce space-separated lists, and
dh-golang doesn't yet support it, so this is just a step towards
generally allowing it everywhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant