MCPcopy Create free account
hub / github.com/devfullcycle/goexpert / runCreate

Function runCreate

16-CLI/cmd/create.go:20–30  ·  view source on GitHub ↗
(categoryDb database.Category)

Source from the content-addressed store, hash-verified

18}
19
20func runCreate(categoryDb database.Category) RunEFunc {
21 return func(cmd *cobra.Command, args []string) error {
22 name, _ := cmd.Flags().GetString("name")
23 description, _ := cmd.Flags().GetString("description")
24 _, err := categoryDb.Create(name, description)
25 if err != nil {
26 return err
27 }
28 return nil
29 }
30}
31
32func init() {
33 createCmd := newCreateCmd(GetCategoryDB(GetDb()))

Callers 1

newCreateCmdFunction · 0.85

Calls 1

CreateMethod · 0.65

Tested by

no test coverage detected