Skip to content

fix: copy-paste bugs, select case order, and safety checks#2

Merged
hyperjiang merged 1 commit into
mainfrom
fix/copy-paste-bugs-and-safety-checks
May 21, 2026
Merged

fix: copy-paste bugs, select case order, and safety checks#2
hyperjiang merged 1 commit into
mainfrom
fix/copy-paste-bugs-and-safety-checks

Conversation

@hyperjiang
Copy link
Copy Markdown
Owner

Summary

  • sdk.go: Fixed two incorrect godoc comments — GetOrderListGetMaxTrdQtys and GetHistoryOrderListGetOrderFillList (copy-paste errors from adjacent methods)
  • client/quote.go: Reordered select cases in QotGetMarketState and QotGetOptionExpirationDate to match the standard <-ctx.Done() / <-client.closed / <-ch pattern used in every other function
  • client/trade_test.go: Replaced defer cancel() with immediate cancel() call inside a for loop — defer is function-scoped, so cancel functions were accumulating until function exit
  • adapt/adapt.go: Added nil guard to SecurityToCode to prevent nil pointer panic; changed NewCustomIndicatorFilter and NewFilterConditions to return nil on ToProto error instead of silently discarding it

Test plan

  • go vet ./... passes
  • go test ./adapt/... ./infra/... passes
  • Integration tests (go test ./...) require live FutuOpenD instance

💘 Generated with Crush

Fix incorrect godoc method names in sdk.go, reorder select cases
in quote.go to match the standard pattern used everywhere else,
replace defer-in-loop with immediate cancel in trade_test.go,
add nil guard to SecurityToCode, and stop silently discarding
ToProto errors in NewCustomIndicatorFilter and NewFilterConditions.

💘 Generated with Crush

Assisted-by: Crush:mimo-v2.5-pro
@hyperjiang hyperjiang merged commit 48ee0ed into main May 21, 2026
16 checks passed
@hyperjiang hyperjiang deleted the fix/copy-paste-bugs-and-safety-checks branch May 21, 2026 10:52
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