-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix: rename package to match directory name #72
Conversation
Hi @zaibon ! thanks for the PR. I was wondering.. is there a specific reason for this change? import (
"testing"
"github.com/edoardottt/depsdev/pkg/client"
def "github.com/edoardottt/depsdev/pkg/depsdev/definitions"
"github.com/stretchr/testify/require"
) See https://github.com/edoardottt/depsdev/blob/devel/pkg/depsdev/v3/api_internal_test.go#L21 How this will change? thanks :) |
Usually, the name of you package follow the name of the directory where it lives. It's not mandatory, but that's what you usually see. At the moment, because both package are called Actually, now that I'm looking at it. the package located at |
Suggest what you think it'd the best option :) I'm all ears! I renamed the packages in a rush cuz I wanted to fit v3 and v3alpha in the same place. |
Ok, I understand where this comes from now. I've had a look at the code in the type API struct {
client *client.Client
}
// NewV3AlphaAPI creates and returns a V3Alpha API object.
func NewV3AlphaAPI() *API {
return &API{
client: client.New(V3AlphaBasePath),
}
}
// NewV3API creates and returns a V3 API object.
func NewV3API() *API {
return &API{
client: client.New(V3BasePath),
}
} This would allow you to still be able to instantiate a client for any version of the API you want to reach, but without all the duplicate code. I can push this proposal in this PR, so you can have a look on how it would feel. |
for now there is no difference, but the plan is to implement some methods only for the alpha version, check the issues. eventually they will be added to the stable version too (V3) but for now they aren't available. |
Ok, these things are bound to diverse at some point, that make sense. So let's forget this PR altogether, it doesn't really solve anything then. |
fine @zaibon :) If you want to contribute...every contribution is more than welcome! |
No description provided.