Menu

Check both response layers in a Go MT4/MT5 copier client
📰

Check both response layers in a Go MT4/MT5 copier client

DEV Community: go·Timur Khamatov·2 days ago
#HvCR4CCA
#devtogo#devto#dev#list#reply
Long article (753 words) — no AI summary yet.
Reading 0:00
15s threshold

Disclosure: I work on MetaRPC, which provides developer APIs, SDKs and hosted software. This article was prepared with AI assistance. The code below was executed against local fixtures; it does not demonstrate a live trade or successful production authentication.

A read-only request is a useful first step when integrating a trade copier: can the client list the copier records owned by this API key? Before interpreting the result, check the contract of the wrapper you are using.

In the current MetaRPC GoCopier wrapper, a failed RPC can become a reply with Ok: false and an Error string, while the returned Go error is nil . Checking only err can therefore send your program down its success path after a refusal or a timeout.

This behavior belongs to this wrapper. It is not a general rule that generated Go gRPC clients discard transport errors.

The check to make

The core sequence is:

reply , err := service . List ( ctx ) if err != nil { // Handle a Go-level failure.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.