refactor: add String() methods to domain types, replace string() casts

This commit is contained in:
user
2026-02-23 11:58:00 -08:00
parent 594537e6f5
commit 3a1b1e3cd4
5 changed files with 32 additions and 23 deletions

View File

@@ -6,11 +6,20 @@ package domain
// ImageID is a Docker image identifier (ID or tag).
type ImageID string
// String implements the fmt.Stringer interface.
func (id ImageID) String() string { return string(id) }
// ContainerID is a Docker container identifier.
type ContainerID string
// String implements the fmt.Stringer interface.
func (id ContainerID) String() string { return string(id) }
// UnparsedURL is a URL stored as a plain string without parsing.
// Use this instead of string when the value is known to be a URL
// but should not be parsed into a net/url.URL (e.g. webhook URLs,
// compare URLs from external payloads).
type UnparsedURL string
// String implements the fmt.Stringer interface.
func (u UnparsedURL) String() string { return string(u) }