Skip to content

Commit

Permalink
[chore] Small nits in component.ID, add extra details in comments (#1…
Browse files Browse the repository at this point in the history
…2029)

Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Jan 6, 2025
1 parent ff4c0a1 commit 67fdcd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions component/identifiable.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 67fdcd1

Please sign in to comment.