compose-go/format
Nicolas De Loof 2fc4e8baac format: tell whether a volume can be said in the short syntax
ShortSyntax renders a volume as `[SOURCE:]TARGET[:OPTIONS]` when some
spelling of it parses back as the very same volume, and
IsShortSyntaxExpressible reports it. A volume the short syntax has no place
for (tmpfs, image, subpath, labels, consistency, extensions, a bind that
doesn't create its host path or is recursive...) or would read otherwise
(a colon in a path, a bind source that is not a path, a one letter volume
name read as a drive) is not expressible, and can only be written in the
long syntax.

It lets an implementation decide, without guessing from each option, which
volumes it can hand over as a plain string (the `Binds` of the Docker API)
and which need more.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
History 2026-11-12 10:14:32 +01:00
..
volume.go format: read a single letter before a colon as a Windows drive, like docker/cli 2026-10-25 11:58:58 +01:00
volume_fuzz_test.go format: read a single letter before a colon as a Windows drive, like docker/cli 2026-10-25 11:58:58 +01:00
volume_short.go format: tell whether a volume can be said in the short syntax 2026-11-12 10:14:32 +01:00
volume_short_test.go format: tell whether a volume can be said in the short syntax 2026-11-12 10:14:32 +01:00
volume_test.go format: read a single letter before a colon as a Windows drive, like docker/cli 2026-10-25 11:58:58 +01:00