Skip to content

The execute path of import is wrong after generated by cobra-cli command #74

@cuizhaoyue

Description

@cuizhaoyue
  1. Create a demo
mkdir -p cobra
cd cobra
cobra-cli init --viper demo
  1. Check the generated main.go file
$ cat demo/main.go 
/*
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
*/
package main

import "github.con/cuizhaoyue/go-demo/cobra/cmd"

func main() {
        cmd.Execute()
}
  1. the import in main.go is wrong
    The correct path should be
github.con/cuizhaoyue/go-demo/cobra/demo/cmd

rather than

github.con/cuizhaoyue/go-demo/cobra/cmd
  1. version info
    The cobra-cli version is the latest version as of 2023-03-04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions