Skip to content

Commit

Permalink
Convert.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Dec 14, 2024
1 parent d7831c2 commit 22e0763
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions models/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ func (e *Event) PrimaryKeys() []string {
func (e *Event) PrimaryKeyValue() string {
var key string
for _, pk := range e.PrimaryKeys() {
// Convert float64 to int64
value := e.PrimaryKeyMap[pk]
switch castedValue := value.(type) {
case float64:
e.PrimaryKeyMap[pk] = int64(castedValue)
}

key += fmt.Sprintf("%s=%v", pk, e.PrimaryKeyMap[pk])
}

Expand Down

0 comments on commit 22e0763

Please sign in to comment.