databricks / cli

Databricks CLI
Other
148 stars 56 forks source link

go module `github.com/databricks/cli` contains invalid paths when importing as dependency #1629

Closed sgerloff closed 3 months ago

sgerloff commented 3 months ago

Describe the issue

Inspired by my feature request, I wanted to explore building the functionality myself using github.com/databricks/cli/libs as a dependency to build on top. In essence, exposing your github.com/databricks/cli/libs as valid go modules enables your customers with special needs and fosters a community that voluntarily owns functionality you do not want to maintain.

Steps to reproduce the behavior

  1. Create dummy go project: go mod init whatever
  2. Add databricks cli as dependency go get github.com/databricks/cli

Expected Behavior

go get github.com/databricks/cli finishes without error

Actual Behavior

go get github.com/databricks/cli finishes with error:

go: downloading github.com/databricks/cli v0.224.1
go: github.com/databricks/cli/libs: create zip: libs/template/testdata/template-in-path/template/{{template `dir_name`}}/{{template `file_name`}}: malformed file path "libs/template/testdata/template-in-path/template/{{template `dir_name`}}/{{template `file_name`}}": invalid char '`'
libs/template/testdata/templated-defaults/template/{{template `dir_name`}}/{{template `file_name`}}: malformed file path "libs/template/testdata/templated-defaults/template/{{template `dir_name`}}/{{template `file_name`}}": invalid char '`'

Note

pietern commented 3 months ago

Thanks for reporting. I hadn't tried this before but the repository should be usable as a module.

That said, don't expect that all libraries under libs to be stable in terms of public API. We may refactor these as needed.