英文:
How to access a go struct whilst only being given one property of it?
问题
假设你有一个结构体的属性。你也知道结构体类型的名称,但是有一个特定的结构体叫做StructAccess,你想要定位它。你只知道id这个属性的值,其他属性一无所知。如何通过只有id的值(StructAccess.ID)获取StructAccess的其他值呢?
只是问一下。
英文:
So lets say you have one property of a struct. You also know the name of the struct type, but there is a specific struct created called StructAccess you want to target. You know the id, but only that property, and none others. How would you get the other values of StructAccess with only the value of id (StructAccess.ID)
Just Asking.
答案1
得分: 2
你只有id (StructAccess.ID)的值,无法获取StructAccess的其他值。这是不可能的。
英文:
> How would you get the other values of StructAccess with only the value of id (StructAccess.ID)
Not at all. This is impossible.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论