diff --git a/component/identifiable.go b/component/identifiable.go index aebacf087e1..0b2c9cdf722 100644 --- a/component/identifiable.go +++ b/component/identifiable.go @@ -84,9 +84,10 @@ func NewID(typeVal Type) ID { } // MustNewID builds a Type and returns a new ID with the given Type and empty name. +// This is equivalent to NewID(MustNewType(typeVal)). // See MustNewType to check the valid values of typeVal. func MustNewID(typeVal string) ID { - return ID{typeVal: MustNewType(typeVal)} + return NewID(MustNewType(typeVal)) } // NewIDWithName returns a new ID with the given Type and name. @@ -95,9 +96,10 @@ func NewIDWithName(typeVal Type, nameVal string) ID { } // MustNewIDWithName builds a Type and returns a new ID with the given Type and name. +// This is equivalent to NewIDWithName(MustNewType(typeVal), nameVal). // See MustNewType to check the valid values of typeVal. func MustNewIDWithName(typeVal string, nameVal string) ID { - return ID{typeVal: MustNewType(typeVal), nameVal: nameVal} + return NewIDWithName(MustNewType(typeVal), nameVal) } // Type returns the type of the component.