main.go 668 B

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/spf13/cobra"
  5. )
  6. func init() {
  7. }
  8. func main() {
  9. rootCmd := &cobra.Command{Use: "my cmd"}
  10. rootCmd.AddCommand(timeTask())
  11. //rootCmd.AddCommand(bidding())
  12. if err := rootCmd.Execute(); err != nil {
  13. fmt.Println("rootCmd.Execute failed", err.Error())
  14. }
  15. }
  16. // @Description 供应商/经销商数据
  17. // @Author J 2022/8/11 16:49
  18. func timeTask() *cobra.Command {
  19. cmdClient := &cobra.Command{
  20. Use: "time task",
  21. Short: "Start processing inc field data",
  22. Run: func(cmd *cobra.Command, args []string) {
  23. //task()
  24. },
  25. }
  26. //cmdClient.Flags().StringVarP(&cfg, "conf", "c", "", "server config [toml]")
  27. return cmdClient
  28. }