This commit is contained in:
Leufolium 2024-07-28 18:37:56 +08:00
parent 76db68e203
commit 7c41247a04
1 changed files with 17 additions and 5 deletions

View File

@ -644,16 +644,28 @@ func main() {
460716,
}
outfilePath := "/app/dataprep/outfile.txt"
outfile, err := os.OpenFile(outfilePath, os.O_WRONLY|os.O_CREATE, 0666)
outfile1, err := os.OpenFile("/app/dataprep/outfile1.txt", os.O_WRONLY|os.O_CREATE, 0666)
if err != nil {
fmt.Printf("Open File Err : %v", err)
}
defer outfile.Close()
writer := bufio.NewWriter(outfile)
defer outfile1.Close()
writer1 := bufio.NewWriter(outfile1)
outfile2, err := os.OpenFile("/app/dataprep/outfile2.txt", os.O_WRONLY|os.O_CREATE, 0666)
if err != nil {
fmt.Printf("Open File Err : %v", err)
}
defer outfile2.Close()
writer2 := bufio.NewWriter(outfile2)
midss := [][]int64{mids1, mids2}
for _, mids := range midss {
for i, mids := range midss {
var writer *bufio.Writer
if i == 0 {
writer = writer1
} else {
writer = writer2
}
accounts, err := client.GetAccountListByMids(ctx, mids)
if err != nil {
fmt.Printf("GetAccountListByMids fail, err :%v\n", err)