Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Module name prevents vendoring this as a tool #61

Open
ojkelly opened this issue Jul 21, 2022 · 1 comment
Open

[BUG] Module name prevents vendoring this as a tool #61

ojkelly opened this issue Jul 21, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@ojkelly
Copy link

ojkelly commented Jul 21, 2022

What is the bug?
The project cannot be vendored as a tool. More info on the concept https://marcofranssen.nl/manage-go-tools-via-go-modules

How can one reproduce the bug?

  1. either go install github.com/opensearch-project/opensearch-cli@main
go install github.com/opensearch-project/opensearch-cli@main                                        
go: github.com/opensearch-project/opensearch-cli@main: github.com/opensearch-project/opensearch-cli@v1.1.1-0.20220614170259-6cc9916c0aac: parsing go.mod:
        module declares its path as: opensearch-cli
                but was required as: github.com/opensearch-project/opensearch-cli
  1. or running go mod tidy && go mod vendor with a tools.go file as follows
# tools.go

//go:build tools
// +build tools

// This package is used to enable vendoring of tooling used in the repo, that is
// run via cli, and not imported anywhere.
package tools

import (
	_ "github.com/opensearch-project/opensearch-cli"
)

What is the expected behavior?

The project to be vendored in the repo.

What is your host/environment?

  • OS: macos
  • Version: go 1.18
  • Plugin version: n/a
  • OpenSearch version: n/a
@ojkelly ojkelly added bug Something isn't working untriaged labels Jul 21, 2022
@wbeckler wbeckler removed the untriaged label Dec 8, 2022
@wbeckler
Copy link

wbeckler commented Dec 8, 2022

Seems like a worthwhile fix. Feel free to contribute a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants