Skip to content

[Bug]: Unsupported mount diagnostic formats MountType with a string verb #3909

Description

@HNO3Miracle

Testcontainers version

main at 33eefc1

Using the latest Testcontainers version?

Yes, checked the current main branch.

Host OS

Linux (WSL)

Host arch

amd64

Go version

go1.26.3 linux/amd64

Docker version

Not needed to reproduce this formatting defect; it is in the unsupported-mount diagnostic before any Docker operation.

Docker info

Not applicable to the diagnostic formatting.

What happened?

In mapToDockerMounts, the BindMounter branch prints m.Source.Type() with %s. MountType is a defined uint type with no String method, so a bind mount (type 0) produces a formatting error marker instead of the mount type.

Expected: a diagnostic containing the mount type without a fmt error marker. I would like to change this verb to %v and can submit a small fix. The affected mount tests pass with that change (go test -run 'Test.*Mount' ./). Opening this issue first as requested by the contribution guide.

Relevant log output

fmt.Sprintf("%s", testcontainers.MountTypeBind) produces %!s(testcontainers.MountType=0).

Additional information

This changes diagnostic formatting only, not which mounts are supported. The complete Docker integration suite has not been run.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions