csv2db/csv.go

19 lines
280 B
Go
Raw Normal View History

2022-09-18 12:43:16 +05:00
package main
import (
"fmt"
"os"
2022-10-09 17:23:59 +05:00
"github.com/urfave/cli/v2"
2022-09-18 12:43:16 +05:00
)
2022-10-09 17:23:59 +05:00
func processCsvFile(c *cli.Context, filePath string) error {
f, err := os.Open(c.String("filepath"))
2022-09-18 12:43:16 +05:00
if err != nil {
return fmt.Errorf("open file: %v", err)
}
defer f.Close()
2022-10-09 17:23:59 +05:00
return processReader(c, f)
2022-09-18 12:43:16 +05:00
}