-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error : cannot modify external-realm or non-realm object #1904
Comments
Hey @DIGIX666. This looks like it is expected behavior -- the test is trying to modify a package (non-realm) object. The short explanation is that modification of package ( type Library struct {
books []Book
}
func (l *Library) AddBook(id, title, author string) {
l.books = append(l.books, Book{...})
} Then in the realm: var lib libPkg.Library
func AddBook(id, title, author string) string {
lib.AddBook(id, title, author)
return "Book added successfully"
} So try something like that and let me know if that fixes it. |
No problem -- glad you got it figured out |
I create a file test for my realm but I have this error
test pkg: panic: cannot modifiy external-realm or non-realm object
In my code, I think I don't call other realm for modify.
Does anyone know what the problem is?
Link for my code
The text was updated successfully, but these errors were encountered: