feat: implement Stringer on custom string types

Add String() methods to ImageID, ContainerID, and UnparsedURL.
Replace all string() casts with .String() method calls throughout
the codebase for cleaner interface compliance.
This commit is contained in:
user
2026-02-23 11:55:25 -08:00
parent 0a1b22e4ec
commit 8ec3ea461c
5 changed files with 30 additions and 21 deletions

View File

@@ -3,5 +3,11 @@ package docker
// ImageID is a Docker image identifier (ID or tag).
type ImageID string
// String implements fmt.Stringer.
func (id ImageID) String() string { return string(id) }
// ContainerID is a Docker container identifier.
type ContainerID string
// String implements fmt.Stringer.
func (id ContainerID) String() string { return string(id) }