This repository was archived by the owner on Aug 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 247
Unable to marshal struct Item #189
Comments
Seems a problem of json package. |
I ran your script here and got no problems. This was the output: {
"taken_at": 1544296347,
"pk": 1930020110127549904,
"id": "1930020110127549904_25025320",
"comments_disabled": false,
"device_timestamp": 154429593946257,
"media_type": 1,
"code": "BrIzxCBg03Q",
"client_cache_key": "MTkzMDAyMDExMDEyNzU0OTkwNA==.2",
"filter_type": 0,
"carousel_parent_id": "",
"user": {
"pk": 25025320,
"username": "instagram",
"full_name": "Instagram",
"biography": "",
"profile_pic_url": "https://instagram.fcpq2-1.fna.fbcdn.net/vp/b842b706ed884b2e6d9d1ad8d2940967/5C8BB15B/t51.2885-19/s150x150/14719833_310540259320655_1605122788543168512_a.jpg",
"email": "",
"phone_number": "",
"is_business": false,
"gender": 0,
"profile_pic_id": "1360316971354486387_25025320",
"has_anonymous_profile_picture": false,
"is_private": false,
"is_unpublished": false,
"allowed_commenter_type": "",
"is_verified": true,
"media_count": 0,
"follower_count": 0,
"following_count": 0,
"following_tag_count": 0,
"profile_context_mutual_follow_ids": null,
"profile_context": "",
"geo_media_count": 0,
"external_url": "",
"has_biography_translation": false,
"external_lynx_url": "",
"biography_with_entities": {
"raw_text": "",
"entities": null
},
"usertags_count": 0,
"has_chaining": false,
"is_favorite": false,
"is_favorite_for_stories": false,
"is_favorite_for_highlights": false,
"can_be_reported_as_fraud": false,
"show_shoppable_feed": false,
"shoppable_posts_count": 0,
"reel_auto_archive": "on",
"has_highlight_reels": false,
"public_email": "",
"public_phone_number": "",
"public_phone_country_code": "",
"contact_phone_number": "",
"city_id": 0,
"city_name": "",
"address_street": "",
"direct_messaging": "",
"latitude": 0,
"longitude": 0,
"category": "",
"business_contact_method": "",
"include_direct_blacklist_status": false,
"hd_profile_pic_url_info": {
"height": 0,
"url": "",
"width": 0
},
"hd_profile_pic_versions": null,
"school": {},
"byline": "",
"mutual_followers_count": 0,
"is_call_to_action_enabled": false,
"fb_page_call_to_action_id": "",
"zip": "",
"friendship_status": {
"incoming_request": false,
"followed_by": false,
"outgoing_request": false,
"following": false,
"blocking": false,
"is_private": false,
"muting": false,
"is_muting_reel": false
}
},
"can_viewer_reshare": true,
"caption": {
"pk": 17992369978118358,
"user_id": 25025320,
"text": "Photo by @smallstepsaregiantleaps \nGreetings earthlings. This is 7-year-old kid astronaut and first-grader Harrison Sheldon. 🚀He’s the star of @smallstepsaregiantleaps, a photo project that his dad, editorial photographer and nonprofit media consultant Aaron Sheldon, started when Harrison was 4 years old. \nInstagram: Aaron, is there a game attached to the project?\nAaron: When we decide to visit a place for the project, we talk about what we might see there. During our visit, I have Harry compare what we thought we might see with the actual experience. My favorite part of each shoot is hearing his thoughts about the places and what he liked about each place as we look at the pictures together over a post-mission doughnut, cookie or ice-cream cone. \nIG: Astronaut Harrison, what’s the best part of being an astronaut?\nHarrison: Exploring places, meeting astronauts, bouncing on hotel beds, having cool exploring gear and snacks. \nIG: Astronaut Harrison, what do you want to be when you grow up?\nHarrison: Superhero.\nAaron: What if your plan to create your own superpowers doesn’t work out? What would you be if you can’t be a superhero?\nHarrison: Police officer and construction worker in space. \nCheck out today’s story to explore along with Harrison and Aaron on some of their adventures.",
"type": 1,
"created_at": 1544296348,
"created_at_utc": 1544296348,
"content_type": "comment",
"status": "Active",
"bit_flags": 0,
"user": {
"pk": 25025320,
"username": "instagram",
"full_name": "Instagram",
"biography": "",
"profile_pic_url": "https://instagram.fcpq2-1.fna.fbcdn.net/vp/b842b706ed884b2e6d9d1ad8d2940967/5C8BB15B/t51.2885-19/s150x150/14719833_310540259320655_1605122788543168512_a.jpg",
"email": "",
"phone_number": "",
"is_business": false,
"gender": 0,
"profile_pic_id": "1360316971354486387_25025320",
"has_anonymous_profile_picture": false,
"is_private": false,
"is_unpublished": false,
"allowed_commenter_type": "",
"is_verified": true,
"media_count": 0,
"follower_count": 0,
"following_count": 0,
"following_tag_count": 0,
"profile_context_mutual_follow_ids": null,
"profile_context": "",
"geo_media_count": 0,
"external_url": "",
"has_biography_translation": false,
"external_lynx_url": "",
"biography_with_entities": {
"raw_text": "",
"entities": null
},
"usertags_count": 0,
"has_chaining": false,
"is_favorite": false,
"is_favorite_for_stories": false,
"is_favorite_for_highlights": false,
"can_be_reported_as_fraud": false,
"show_shoppable_feed": false,
"shoppable_posts_count": 0,
"reel_auto_archive": "on",
"has_highlight_reels": false,
"public_email": "",
"public_phone_number": "",
"public_phone_country_code": "",
"contact_phone_number": "",
"city_id": 0,
"city_name": "",
"address_street": "",
"direct_messaging": "",
"latitude": 0,
"longitude": 0,
"category": "",
"business_contact_method": "",
"include_direct_blacklist_status": false,
"hd_profile_pic_url_info": {
"height": 0,
"url": "",
"width": 0
},
"hd_profile_pic_versions": null,
"school": {},
"byline": "",
"mutual_followers_count": 0,
"is_call_to_action_enabled": false,
"fb_page_call_to_action_id": "",
"zip": "",
"friendship_status": {
"incoming_request": false,
"followed_by": false,
"outgoing_request": false,
"following": false,
"blocking": false,
"is_private": false,
"muting": false,
"is_muting_reel": false
}
},
"did_report_as_spam": false,
"media_id": 1930020110127549904,
"has_translation": false
},
"caption_is_edited": false,
"like_count": 882985,
"has_liked": false,
"top_likers": [
"enkisoma",
"mello_gabriel04",
"rafah_andreolii"
],
"likers": null,
"comment_likes_enabled": true,
"comment_threading_enabled": true,
"has_more_comments": true,
"max_num_visible_preview_comments": 2,
"preview_comments": [],
"comment_count": 10874,
"photo_of_you": false,
"usertags": {
"in": null
},
"fb_user_tags": {
"in": null
},
"can_viewer_save": true,
"organic_tracking_token": "eyJ2ZXJzaW9uIjo1LCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjp0cnVlLCJ1dWlkIjoiZDhiNjE5ZmIxN2MxNDZhNjg5YmJhYmE0ZjkxMjIxZTQxOTMwMDIwMTEwMTI3NTQ5OTA0Iiwic2VydmVyX3Rva2VuIjoiMTU0NDQ1Mjc2MTM3MXwxOTMwMDIwMTEwMTI3NTQ5OTA0fDk0MTg3NDg0MzN8ZGMyMjc4MjA1YTUxNjdmNWRiOWZlYjkzODRhZGRhYzZmZDQ4MjEzNzkxZjU0OGQ5NzE1NzFiNjYzOGExNzlmMSJ9LCJzaWduYXR1cmUiOiIifQ==",
"image_versions2": {
"candidates": [
{
"width": 1080,
"height": 1080,
"url": "https://instagram.fcpq2-1.fna.fbcdn.net/vp/fdc3ccf36a269295a955165d1390761e/5CA4ADCA/t51.2885-15/e35/45404528_196007357911855_2495553744348210134_n.jpg?_nc_ht=instagram.fcpq2-1.fna.fbcdn.net&se=8&ig_cache_key=MTkzMDAyMDExMDEyNzU0OTkwNA%3D%3D.2"
},
{
"width": 240,
"height": 240,
"url": "https://instagram.fcpq2-1.fna.fbcdn.net/vp/1c8c67bc5376ca6307fbca97bf64483d/5C9E84C2/t51.2885-15/e35/s240x240/45404528_196007357911855_2495553744348210134_n.jpg?_nc_ht=instagram.fcpq2-1.fna.fbcdn.net&ig_cache_key=MTkzMDAyMDExMDEyNzU0OTkwNA%3D%3D.2"
}
]
},
"original_width": 1080,
"original_height": 1080,
"location": {
"pk": 212928653,
"name": "Miami Beach, Florida",
"address": "",
"city": "",
"short_name": "Miami Beach",
"lng": -80.1341,
"lat": 25.813,
"external_source": "facebook_places",
"facebook_places_id": 108260802527498
},
"lat": 25.813,
"lng": -80.1341,
"story_events": null,
"story_hashtags": null,
"story_polls": null,
"story_feed_media": null,
"story_sound_on": null,
"creative_config": null,
"story_locations": null,
"story_sliders": null,
"story_questions": null,
"story_product_items": null,
"supports_reel_reactions": false,
"show_one_tap_fb_share_tooltip": false,
"has_shared_to_fb": 0,
"Mentions": null
} Is this exactly the code that you are running this problem? Try serializing one item at a time. |
That's weird. I just tried it and I still hit the same exception.
And yes, I'm still hitting the same exception. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've successfully written a tiny wrapper around your project to use it via gomobile. So far, I've been able to login, search for users, etc.
The gomobile bindings only allow functions to return basic datatypes:
int
,char
,string
,[]byte
, etc. As a consequence, I need to marshal some results into strings before returning.One issue I've run into which I don't quite know how to solve is that the
Item
struct fails to be marshalled. It ends up in an infinite loop somehow and eventually fails with a stack overflow error:If you have any insight into why this might be happening, I can try and come up with a PR to solve this.
The text was updated successfully, but these errors were encountered: