Skip to content

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

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

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

Conversation

@rhansen
Copy link
Copy Markdown
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.

@rhansen rhansen force-pushed the go-import-path-syntax branch from cf5f502 to ef5dd77 Compare February 26, 2026 22:03
@rhansen rhansen force-pushed the go-import-path-syntax branch 3 times, most recently from 60ecc55 to e5b8257 Compare March 13, 2026 03:31
@rhansen rhansen force-pushed the go-import-path-syntax branch from e5b8257 to 605982a Compare March 13, 2026 22:26
rhansen added 3 commits March 29, 2026 01:52
This should have been part of commit
9f00e05 but I forgot that `With*` is
the idiomatic way to name functions that return options.
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.
@rhansen rhansen force-pushed the go-import-path-syntax branch from 605982a to 180330a Compare March 29, 2026 05:54
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