type Apis struct {
Items []struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
CreatedDate int `json:"createdDate"`
APIKeySource string `json:"apiKeySource"`
EndpointConfiguration struct {
Types []string `json:"types"`
} `json:"endpointConfiguration"`
} `json:"items"`
}
这是我定义的结构,用于存储我以 json 格式获得的 API。如何通过名称获取特定 API,然后获取其 ID。例如,假设apiname == Shopping我希望将 Shopping API 的 ID 分配给id变量。
ps:我是golang的新手,非常感谢解释清楚的答案。多谢你们
吃鸡游戏
相关分类