mirror of
https://github.com/nxshock/csv2db.git
synced 2024-11-27 03:31:00 +05:00
19 lines
280 B
Go
19 lines
280 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
func processCsvFile(c *cli.Context, filePath string) error {
|
|
f, err := os.Open(c.String("filepath"))
|
|
if err != nil {
|
|
return fmt.Errorf("open file: %v", err)
|
|
}
|
|
defer f.Close()
|
|
|
|
return processReader(c, f)
|
|
}
|