Skip to content

Commit df1a6c8

Browse files
committed
chore: deprecate struct2interface
1 parent 792ef40 commit df1a6c8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cmd/kod/internal/generate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func doGenerate(cmd *cobra.Command, dir string, args []string) {
5858
}
5959

6060
func init() {
61-
generate.Flags().BoolP("struct2interface", "s", false, "generate interface from struct.")
61+
generate.Flags().BoolP("struct2interface", "s", true, "generate interface from struct.")
6262
generate.Flags().BoolP("verbose", "v", false, "verbose mode.")
6363
generate.Flags().BoolP("watch", "w", false, "watch the changes of the files and regenerate the codes.")
6464
rootCmd.AddCommand(generate)

cmd/kod/internal/struct2interface.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,9 @@ func Struct2Interface(c *cobra.Command, dir string) error {
371371
}
372372

373373
var struct2interface = &cobra.Command{
374-
Use: "struct2interface",
375-
Short: "generate interface from struct for your kod application.",
374+
Use: "struct2interface",
375+
Deprecated: "use `kod generate` instead",
376+
Short: "generate interface from struct for your kod application.",
376377
// Uncomment the following line if your bare application
377378
// has an action associated with it:
378379
// Run: func(cmd *cobra.Command, args []string) { },

0 commit comments

Comments
 (0)