diff --git a/example/GetETFCodeNumber/main.go b/example/GetETFCodeNumber/main.go new file mode 100644 index 0000000..71a4873 --- /dev/null +++ b/example/GetETFCodeNumber/main.go @@ -0,0 +1,29 @@ +package main + +import ( + "strings" + + "github.com/injoyai/logs" + "github.com/injoyai/tdx" +) + +func main() { + cs, err := tdx.NewCodes2() + logs.PanicErr(err) + + ls := cs.GetETFCodes() + + shNumber := 0 + szNumber := 0 + for _, v := range ls { + switch { + case strings.HasPrefix(v, "sh"): + shNumber++ + case strings.HasPrefix(v, "sz"): + szNumber++ + } + } + + logs.Debug("sh:", shNumber) + logs.Debug("sz:", szNumber) +} diff --git a/protocol/unit.go b/protocol/unit.go index 6d6c6ea..0384c1d 100644 --- a/protocol/unit.go +++ b/protocol/unit.go @@ -286,7 +286,7 @@ func IsETF(code string) bool { return true case code[0:2] == ExchangeSZ.String() && - (code[2:4] == "15" || code[2:4] == "16"): + (code[2:4] == "15"): return true } return false