mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 16:21:09 +00:00
okex: move go generate to the convert file
This commit is contained in:
parent
364e6fc990
commit
3511bcf13f
|
@ -6,6 +6,7 @@ func toGlobalSymbol(symbol string) string {
|
||||||
return strings.ReplaceAll(symbol, "-", "")
|
return strings.ReplaceAll(symbol, "-", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:generate sh -c "echo \"package okex\nvar symbolMap = map[string]string{\n\" $(curl -s -L 'https://okex.com/api/v5/public/instruments?instType=SPOT' | jq -r '.data[] | \"\\(.instId | sub(\"-\" ; \"\") | tojson ): \\( .instId | tojson),\n\"') \"\n}\" > symbols.go"
|
||||||
func toLocalSymbol(symbol string) string {
|
func toLocalSymbol(symbol string) string {
|
||||||
if s, ok := symbolMap[symbol]; ok {
|
if s, ok := symbolMap[symbol]; ok {
|
||||||
return s
|
return s
|
||||||
|
|
|
@ -9,7 +9,6 @@ import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate sh -c "echo \"package okex\nvar symbolMap = map[string]string{\n\" $(curl -s -L 'https://okex.com/api/v5/public/instruments?instType=SPOT' | jq -r '.data[] | \"\\(.instId | sub(\"-\" ; \"\") | tojson ): \\( .instId | tojson),\n\"') \"\n}\" > symbols.go"
|
|
||||||
|
|
||||||
// OKB is the platform currency of OKEx, pre-allocate static string here
|
// OKB is the platform currency of OKEx, pre-allocate static string here
|
||||||
const OKB = "OKB"
|
const OKB = "OKB"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user