lacion / cookiecutter-golang

A Go project template
MIT License
690 stars 178 forks source link

Replace import from example project #30

Closed adriangonz closed 4 years ago

adriangonz commented 4 years ago

Describe the bug After creating a Go project, the version package import on cmd/version.go points to github.com/lacion/cookiecutter_golang_example/version, which I assume is the example project.

To Reproduce

  1. Run cookiecutter https://github.com/lacion/cookiecutter-golang.git
  2. Select use_cobra_cmd [y]: y
  3. Go to the generated cmd/version.go

Expected behavior Instead of github.com/lacion/cookiecutter_golang_example/version, cmd/version.go should import the generated github.com/<github_username>/<app_name>/version.

Desktop (please complete the following information):

Additional context This was using the latest version of the golang template.

adriangonz commented 4 years ago

I assume the problem is here, where it should import instead "github.com/{{cookiecutter.github_username}}/{{cookiecutter.app_name}}/version":

https://github.com/lacion/cookiecutter-golang/blob/d5f0964920f34fab8ba42ce3f90681c062a9f7f1/%7B%7Bcookiecutter.app_name%7D%7D/cmd/version.go#L3-L7