Skip to content

Commit

Permalink
[chore] Small nits in component.ID, add extra details in comments
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Jan 6, 2025
1 parent 306c939 commit d0d9512
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))

Check warning on line 90 in component/identifiable.go

View check run for this annotation

Codecov / codecov/patch

component/identifiable.go#L90

Added line #L90 was not covered by tests
}

// 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)

Check warning on line 102 in component/identifiable.go

View check run for this annotation

Codecov / codecov/patch

component/identifiable.go#L102

Added line #L102 was not covered by tests
}

// Type returns the type of the component.
Expand Down

0 comments on commit d0d9512

Please sign in to comment.