Skip to content

Commit 82ba4df

Browse files
fix(adk): keep memory store go1.18 compatible
Change-Id: Id6e6ecc790137f3b4f2d7a55b37598047e2c92b9
1 parent 7f195a6 commit 82ba4df

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

adk/session/in_memory_store.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ type InMemoryStore[M adk.MessageType] struct {
4545
checkpoints map[string][]byte
4646
}
4747

48+
type pendingEvent struct {
49+
eventID string
50+
kind adk.SessionEventKind
51+
data []byte
52+
}
53+
4854
// NewInMemoryStore creates a new InMemoryStore.
4955
func NewInMemoryStore[M adk.MessageType](cfg *InMemoryStoreConfig) *InMemoryStore[M] {
5056
return &InMemoryStore[M]{
@@ -84,11 +90,6 @@ func (s *InMemoryStore[M]) AppendEvents(_ context.Context, req *adk.AppendSessio
8490
return nil, adk.ErrSessionTailMismatch
8591
}
8692
seen := make(map[string]struct{}, len(events))
87-
type pendingEvent struct {
88-
eventID string
89-
kind adk.SessionEventKind
90-
data []byte
91-
}
9293
pending := make([]pendingEvent, 0, len(events))
9394
for _, e := range events {
9495
if e == nil || e.EventID == "" {

0 commit comments

Comments
 (0)