okex: move go generate to the convert file

This commit is contained in:
c9s 2021-05-26 02:38:44 +08:00
parent 364e6fc990
commit 3511bcf13f
2 changed files with 1 additions and 1 deletions

View File

@ -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

View File

@ -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"