Skip to content

Comments

fix the crash due to wrong reflect type usage#57

Merged
Prabhjot-Sethi merged 1 commit intomainfrom
generic
May 6, 2025
Merged

fix the crash due to wrong reflect type usage#57
Prabhjot-Sethi merged 1 commit intomainfrom
generic

Conversation

@Prabhjot-Sethi
Copy link
Collaborator

it requires to use the type of elem instead of the slice itself fix crash trace like
goroutine 115 [running]:
log.Panicf({0x9aa7f4?, 0x0?}, {0xc000507e48?, 0xd95210?, 0x0?})
/usr/local/go/src/log/log.go:439 +0x65
github.com/Prabhjot-Sethi/core/db.(*mongoCollection).Watch.func1.2()
/home/core/go/pkg/mod/github.com/!prabhjot-!sethi/core@v0.0.0-20250504230306-35d0b36d9034/db/mongo.go:247 +0x7d
github.com/Prabhjot-Sethi/core/db.(*mongoCollection).Watch.func1()
/home/core/go/pkg/mod/github.com/!prabhjot-!sethi/core@v0.0.0-20250504230306-35d0b36d9034/db/mongo.go:299 +0x3c2
created by github.com/Prabhjot-Sethi/core/db.(*mongoCollection).Watch in goroutine 1
/home/core/go/pkg/mod/github.com/!prabhjot-!sethi/core@v0.0.0-20250504230306-35d0b36d9034/db/mongo.go:232 +0x158

it requires to use the type of elem instead of the slice itself
fix crash trace like
goroutine 115 [running]:
log.Panicf({0x9aa7f4?, 0x0?}, {0xc000507e48?, 0xd95210?, 0x0?})
        /usr/local/go/src/log/log.go:439 +0x65
github.com/Prabhjot-Sethi/core/db.(*mongoCollection).Watch.func1.2()
        /home/core/go/pkg/mod/github.com/!prabhjot-!sethi/core@v0.0.0-20250504230306-35d0b36d9034/db/mongo.go:247 +0x7d
github.com/Prabhjot-Sethi/core/db.(*mongoCollection).Watch.func1()
        /home/core/go/pkg/mod/github.com/!prabhjot-!sethi/core@v0.0.0-20250504230306-35d0b36d9034/db/mongo.go:299 +0x3c2
created by github.com/Prabhjot-Sethi/core/db.(*mongoCollection).Watch in goroutine 1
        /home/core/go/pkg/mod/github.com/!prabhjot-!sethi/core@v0.0.0-20250504230306-35d0b36d9034/db/mongo.go:232 +0x158

Signed-off-by: Prabhjot Singh Sethi <prabhjot.sethi@gmail.com>
@Prabhjot-Sethi Prabhjot-Sethi merged commit 3283872 into main May 6, 2025
@Prabhjot-Sethi Prabhjot-Sethi deleted the generic branch May 6, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant