Skip to content

Commit dab9a90

Browse files
committed
Cobraで雛形作成
1 parent 67e256d commit dab9a90

File tree

5 files changed

+322
-0
lines changed

5 files changed

+322
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
csvt.exe

cmd/root.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package cmd
2+
3+
import (
4+
"github.com/spf13/cobra"
5+
)
6+
7+
var cfgFile string
8+
9+
// rootCmd represents the base command when called without any subcommands
10+
var rootCmd = &cobra.Command{
11+
Use: "csvt",
12+
}
13+
14+
// Execute adds all child commands to the root command and sets flags appropriately.
15+
// This is called by main.main(). It only needs to happen once to the rootCmd.
16+
func Execute() {
17+
18+
rootCmd.Run = func(cmd *cobra.Command, args []string) {
19+
_ = rootCmd.Help()
20+
}
21+
22+
cobra.CheckErr(rootCmd.Execute())
23+
}

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/onozaty/csvt
2+
3+
go 1.16
4+
5+
require github.com/spf13/cobra v1.1.3

0 commit comments

Comments
 (0)