← Back

agree devlog - 01/31

Conglomeration

Now taking the list of DTOs and combining them into one []Entity, where each entity holds its source schema and all the others. That way when comparison time comes, there's no need to search for the source, it's already right there on the struct.

Source assignment happens during the conglomeration step all at once, which keeps it slightly faster than assigning lazily.

type Entity struct {
    Name         string
    SourceSchema Schema
    OtherSchemas []Schema
}

Validate()

Added a Validate() method on Entity that checks if SourceSchema is nil before any comparison runs. If it is, it throws an error since there's nothing to compare against without a source.

Might not actually need the explicit validation, could just let comparison blow up naturally if source is nil. Still deciding.