Skip to content

docs(skill): 修正 Go SDK reference 并补齐 content 文档#1062

Closed
huacnlee wants to merge 2 commits into
mainfrom
skill/go-sdk-reference
Closed

docs(skill): 修正 Go SDK reference 并补齐 content 文档#1062
huacnlee wants to merge 2 commits into
mainfrom
skill/go-sdk-reference

Conversation

@huacnlee
Copy link
Copy Markdown
Member

@huacnlee huacnlee commented Jun 2, 2026

背景

评估上一个 PR 新增的 Go SDK skill 文档与 Rust SDK 写法的一致性,修正发现的问题。所有 API 签名均经 openapi-go submodule(v0.21.0)源码核实。

修正项

文件 修改
go-sdk/types.md 删除不存在OutsideRTHOvernight(从 Rust OutsideRTH::Overnight 照搬,用户照写会编译失败),改为真实的 OutsideRTHOnly/OutsideRTHAny/OutsideRTHUnknown
go-sdk/content.md 🆕 新建——Go SDK 有完整 content 包但原 PR 未覆盖。补齐 ContentContext(News/Topics) 与 QuoteContext.Filings
SKILL.md Go SDK 段补 Content 条目;正文 Python/Rust SDKPython/Rust/Go SDK;选型决策表纳入 Go
go-sdk/trade-context.md SubmitOrder 注释补 LimitOffset(TSLPAMT/TSLPPCT 必填)
go-sdk/overview.md 标注版本号 v0.21.0,对齐 rust-sdk 写法

说明

同等改动已同步复制到 longbridge-skills 仓库的 skills/longbridge/references/go-sdk/(独立仓库,需单独提交)。

🤖 Generated with Claude Code

陆逊 and others added 2 commits June 2, 2026 13:40
Add references/go-sdk/ (overview, quote-context, trade-context, types)
mirroring the existing rust-sdk reference set, and link it from SKILL.md.
Content kept concise: high-level method/struct/enum coverage with pointers
to GoDoc + source for exact signatures.

Verified against the real SDK (github.com/longbridge/openapi-go v0.24.1):

1. Compile check — a program exercising every documented method, struct
   field and constant was built with `go build` / `go vet` against v0.24.1.
   Caught and fixed 6 issues:
   - QuoteContext.CalcIndexes -> CalcIndex (method is singular)
   - QuoteContext.Watchlist -> WatchedGroups (list getter)
   - SecurityDepth fields are .Ask / .Bid (not .Asks / .Bids)
   - GetHistoryOrders.StartAt/EndAt are int64 Unix secs (GetHistoryExecutions
     uses time.Time — the two differ; now noted)
   - GetAccountBalance.Currency is trade.Currency (use trade.CurrencyHKD)
   - order quantities (SubmittedQuantity, ReplaceOrder.Quantity) are uint64,
     only price fields use shopspring/decimal

2. Live read-only run — paper-trading account, no orders placed. Verified
   Quote / StaticInfo / Candlesticks / Depth / AccountBalance /
   StockPositions / TodayOrders all return real data with the documented
   field names.

3. Independent cross-review — a second model (kimi) and a separate agent
   re-checked the docs against source; both confirmed the fixes and the
   uint64-vs-decimal correction.
- types.md: 删除不存在的 OutsideRTHOvernight(照搬 Rust 的错误,会编译失败),改为真实的 OutsideRTHOnly/Any/Unknown
- 新增 go-sdk/content.md: 补齐 ContentContext(News/Topics) 与 QuoteContext.Filings,对齐 rust-sdk/content.md
- SKILL.md: Go SDK 段加 Content 条目;正文与选型决策表纳入 Go
- trade-context.md: SubmitOrder 补 LimitOffset(TSLPAMT/TSLPPCT 必填)
- overview.md: 标注版本号 v0.21.0

签名均经 openapi-go v0.21.0 源码核实。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huacnlee huacnlee closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant