fix bug
This commit is contained in:
@@ -42,8 +42,8 @@ func main() {
|
||||
// csv文件写入
|
||||
func WriterCSV(fileName string, datas [][]string) {
|
||||
|
||||
//OpenFile读取文件,不存在时则创建,使用追加模式
|
||||
File, err := os.OpenFile(fileName, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)
|
||||
//OpenFile读取文件,不存在时则创建
|
||||
File, err := os.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
||||
if err != nil {
|
||||
log.Println("文件打开失败!")
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.apinb.com/dataset/stock/internal/logic/a"
|
||||
)
|
||||
|
||||
func main() {
|
||||
t, err := time.Parse("20060102", "20230101")
|
||||
if err != nil {
|
||||
fmt.Println("error", err)
|
||||
}
|
||||
fmt.Println(t)
|
||||
a.NewApiClient()
|
||||
reply, err := a.SetFinaIndicator("000012.SZ", "20230101", "20260124")
|
||||
fmt.Println("Err", err)
|
||||
jsonBytes, _ := json.Marshal(reply.Data.Items)
|
||||
fmt.Println("Reply", string(jsonBytes))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user