1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-09 23:22:28 +08:00

refactor: update signature of WriteMapsToCsv function

g
This commit is contained in:
dudaodong
2024-01-24 11:54:42 +08:00
parent e0c9ccbce3
commit be62aaac9b
9 changed files with 46 additions and 46 deletions

View File

@@ -339,7 +339,8 @@ func ExampleWriteMapsToCsv() {
{"Name": "Jim", "Age": "21", "Gender": "male"},
}
err := WriteMapsToCsv(csvFilePath, records, false, ';')
headers := []string{"Name", "Age", "Gender"}
err := WriteMapsToCsv(csvFilePath, records, false, ';', headers)
if err != nil {
log.Fatal(err)
@@ -350,7 +351,7 @@ func ExampleWriteMapsToCsv() {
fmt.Println(content)
// Output:
// [[Age Gender Name] [22 female Lili] [21 male Jim]]
// [[Name Age Gender] [Lili 22 female] [Jim 21 male]]
}
func ExampleWriteStringToFile() {