Skip to content

Commit 30790c1

Browse files
authored
Merge branch 'main' into codeboten/update-more-references
2 parents ecd8fc1 + f17e470 commit 30790c1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

component/identifiable.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package component // import "go.opentelemetry.io/collector/component"
55

66
import (
7+
"encoding"
78
"errors"
89
"fmt"
910
"regexp"
@@ -71,6 +72,12 @@ func MustNewType(strType string) Type {
7172
return ty
7273
}
7374

75+
var (
76+
_ fmt.Stringer = ID{}
77+
_ encoding.TextMarshaler = ID{}
78+
_ encoding.TextUnmarshaler = (*ID)(nil)
79+
)
80+
7481
// ID represents the identity for a component. It combines two values:
7582
// * type - the Type of the component.
7683
// * name - the name of that component.
@@ -116,7 +123,7 @@ func (id ID) Name() string {
116123

117124
// MarshalText implements the encoding.TextMarshaler interface.
118125
// This marshals the type and name as one string in the config.
119-
func (id ID) MarshalText() (text []byte, err error) {
126+
func (id ID) MarshalText() ([]byte, error) {
120127
return []byte(id.String()), nil
121128
}
122129

0 commit comments

Comments
 (0)