Skip to content

Commit c07d41e

Browse files
committed
Update linters
1 parent 27cbe86 commit c07d41e

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

chasm/registrable_component.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func WithSearchAttributes(searchAttributes []*SearchAttribute) RegistrableCompon
6969
alias := sa.GetAlias()
7070

7171
if existingKey, exists := aliasToKey[alias]; exists {
72+
//nolint:forbidigo // panic is appropriate during component registration setup
7273
panic(fmt.Sprintf(
7374
"duplicate search attribute alias %q: keys %q and %q both map to the same alias",
7475
alias,

chasm/registry_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (s *RegistryTestSuite) TestRegistry_RegisterComponents_WithSearchAttributes
3737
lib := chasm.NewMockLibrary(ctrl)
3838
lib.EXPECT().Name().Return("TestLibrary").AnyTimes()
3939

40-
s.T().Run("successful registration with valid search attributes", func(t *testing.T) {
40+
s.Run("successful registration with valid search attributes", func() {
4141
boolKey := chasm.NewSearchAttributeBoolByIndex("MyBoolKey", 1)
4242
timeKey := chasm.NewSearchAttributeTimeByIndex("MyTimeKey", 1)
4343

@@ -54,14 +54,14 @@ func (s *RegistryTestSuite) TestRegistry_RegisterComponents_WithSearchAttributes
5454

5555
r := chasm.NewRegistry(s.logger)
5656
err := r.Register(lib)
57-
require.NoError(t, err)
57+
s.NoError(err)
5858
})
5959

60-
s.T().Run("no panic with valid keys", func(t *testing.T) {
60+
s.Run("no panic with valid keys", func() {
6161
// Creating valid keys should not panic
6262
boolKey := chasm.NewSearchAttributeBoolByIndex("MyBoolKey", 1)
6363

64-
require.NotPanics(t, func() {
64+
s.NotPanics(func() {
6565
chasm.NewRegistrableComponent[*chasm.MockComponent](
6666
"Component1",
6767
chasm.WithSearchAttributes([]*chasm.SearchAttribute{
@@ -71,12 +71,12 @@ func (s *RegistryTestSuite) TestRegistry_RegisterComponents_WithSearchAttributes
7171
})
7272
})
7373

74-
s.T().Run("panic on duplicate alias", func(t *testing.T) {
74+
s.Run("panic on duplicate alias", func() {
7575
// Both keys trying to use the same alias - should panic
7676
boolKey1 := chasm.NewSearchAttributeBoolByAlias("MyBoolKey1", "DuplicateAlias")
7777
boolKey2 := chasm.NewSearchAttributeBoolByAlias("MyBoolKey2", "DuplicateAlias")
7878

79-
require.Panics(t, func() {
79+
s.Panics(func() {
8080
chasm.NewRegistrableComponent[*chasm.MockComponent](
8181
"Component1",
8282
chasm.WithSearchAttributes([]*chasm.SearchAttribute{

chasm/search_attribute.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,22 @@ func ResolveFieldName(valueType enumspb.IndexedValueType, index int) string {
6464
}
6565
}
6666

67-
// Getter methods for SearchAttribute
67+
// GetKey returns the search attribute key.
6868
func (s *SearchAttribute) GetKey() string {
6969
return s.key
7070
}
7171

72+
// GetAlias returns the search attribute alias (field name).
7273
func (s *SearchAttribute) GetAlias() string {
7374
return s.alias
7475
}
7576

77+
// GetValueType returns the indexed value type.
7678
func (s *SearchAttribute) GetValueType() enumspb.IndexedValueType {
7779
return s.valueType
7880
}
7981

82+
// GetValue returns the search attribute value.
8083
func (s *SearchAttribute) GetValue() any {
8184
return s.value
8285
}

0 commit comments

Comments
 (0)