Skip to content

Commit cdf0281

Browse files
Fix GoLint documentation warnings
1 parent 4e8e832 commit cdf0281

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

metadata/metadata.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func (v *valueData) MarshalJSON() ([]byte, error) {
9898
return json.Marshal(v.AsMap())
9999
}
100100

101+
// UnmarshalJSON unmarshals the provided json into a Metadata instance
101102
func UnmarshalJSON(json []byte) (Metadata, error) {
102103
in := jlexer.Lexer{Data: json}
103104
metadata := New()

mocks/mocks.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ import (
2222

2323
var _ goengine.Message = &DummyMessage{}
2424

25+
// DummyMessage a simple goengine.Message implementation used for testing
2526
type DummyMessage struct {
2627
uuid goengine.UUID
2728
payload interface{}
2829
metadata metadata.Metadata
2930
createdAt time.Time
3031
}
3132

33+
// NewDummyMessage returns a new DummyMessage
3234
func NewDummyMessage(id goengine.UUID, payload interface{}, meta metadata.Metadata, time time.Time) *DummyMessage {
3335
return &DummyMessage{
3436
id,
@@ -38,22 +40,27 @@ func NewDummyMessage(id goengine.UUID, payload interface{}, meta metadata.Metada
3840
}
3941
}
4042

43+
// UUID returns the identifier of this message
4144
func (d *DummyMessage) UUID() goengine.UUID {
4245
return d.uuid
4346
}
4447

48+
// CreatedAt returns the created time of the message
4549
func (d *DummyMessage) CreatedAt() time.Time {
4650
return d.createdAt
4751
}
4852

53+
// Payload returns the payload of the message
4954
func (d *DummyMessage) Payload() interface{} {
5055
return d.payload
5156
}
5257

58+
// Metadata return the message metadata
5359
func (d *DummyMessage) Metadata() metadata.Metadata {
5460
return d.metadata
5561
}
5662

63+
// WithMetadata Returns new instance of the message with key and value added to metadata
5764
func (d *DummyMessage) WithMetadata(key string, value interface{}) goengine.Message {
5865
newMessage := *d
5966
newMessage.metadata = metadata.WithValue(d.metadata, key, value)

0 commit comments

Comments
 (0)