diff --git a/internal/registry/process.go b/internal/registry/process.go index 72d29d1..256a5a9 100644 --- a/internal/registry/process.go +++ b/internal/registry/process.go @@ -33,7 +33,7 @@ func (b convertedProcess[T]) Set(r Repr) error { return b.process.Set(t) } - return fmt.Errorf("Incorrent format '%s' for engine '%s'.", r.Id(), b.inType) + return fmt.Errorf("Incorrent format '%s' for engine '%s'.", r.ID(), b.inType) } func (b convertedProcess[T]) Step(i int) bool { diff --git a/internal/registry/registry.go b/internal/registry/registry.go index 6fce6bf..9171ef5 100644 --- a/internal/registry/registry.go +++ b/internal/registry/registry.go @@ -44,7 +44,7 @@ func (r *Registry) GetDefaultEngine(id string) (Engine, error) { } func (r *Registry) ConvertTo(repr Repr, outType string) (Repr, error) { - path, err := r.ConversionPath(repr.Id(), outType) + path, err := r.ConversionPath(repr.ID(), outType) if err != nil { return nil, err } @@ -61,9 +61,9 @@ func (r *Registry) ConvertTo(repr Repr, outType string) (Repr, error) { } func (r *Registry) Marshal(repr Repr) (string, error) { - m, ok := r.marshalers[repr.Id()] + m, ok := r.marshalers[repr.ID()] if !ok { - return "", fmt.Errorf("no marshaler for '%s'", repr.Id()) + return "", fmt.Errorf("no marshaler for '%s'", repr.ID()) } return m.Encode(repr) diff --git a/internal/registry/repr.go b/internal/registry/repr.go index a8dd19b..95f19ab 100644 --- a/internal/registry/repr.go +++ b/internal/registry/repr.go @@ -4,7 +4,7 @@ type Repr interface { // Id returns to name of the objects underlying representation. If is // assumed that if two Repr objects have the same Id(), they share the same // representation. - Id() string + ID() string Data() any } @@ -14,7 +14,7 @@ type baseRepr struct { data any } -func (r baseRepr) Id() string { return r.id } +func (r baseRepr) ID() string { return r.id } func (r baseRepr) Data() any { return r.data }