Skip to content

请改下代码 #35

Description

@coolspeeder

func (client *Client) StockAll(market uint8) ([]proto.Security, error) {
qc, err := client.quotationClient()
if err != nil {
return nil, err
}
reply := &proto.GetSecurityListReply{}

size := uint32(1000)
for start := uint32(0); ; start += size {
	resp, err := qc.GetSecurityListRange(market, start, size)
	if err != nil {
		return nil, err
	}
	reply.Count += resp.Count
	reply.List = append(reply.List, resp.List...)
	if resp.Count < uint16(size) {
		break
	}
}
return reply.List, nil

}

size := uint32(1000)请改为800,否则msgData has bytes(37002) beyond max 32768

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions