-
Notifications
You must be signed in to change notification settings - Fork 145
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
log15.Record compatibility across third-party packages #53
Comments
I don't think there's a change here that will make it better, to be honest. It's not ideal that you need to import the package just to implement the Handler interface, but I think any of the other options are just more complicated and burdensome. |
@inconshreveable Agreed. I have been thinking about this issue, and I'm not convinced there is a good solution either. One approach is to define the This issue can serve to document one of the hidden costs of API changes. |
I have had issues with using the versioned form of the URL repo as well. As a solution I have been using a manifest file to pull in the labeled version of the repo directly from github onto my gopath. that works consistent enough for me. |
@notzippy You are talking about |
@ChrisHines The code completor for intellij insisted that log15 needed to be on the end of the import statement (like |
@notzippy I think about 30-40% of all non-std packages use a package name that doesn't match the directory they're in.. Lots of packages are prefixed with |
In #51 @ChrisHines wrote:
Excelent point! Even though the
Record
structure stays the same, the types will be incompatible because the qualified identifier is different.inconshreveable/log15.v2/record
One solution would be moving
Record
to it's own packagelog15.v2/record
.Then log15.v3 will still import
log15.v2/record
, as will everyone that writes a custom handler.If at v6 we want to make a breaking change the Record type, then
log15.v6
will importlog15.v6/record
, and everyone will have to update their Handlers to work with v6.inconshreveable/log15record.v1
The strange thing about the above
log15.v2/record
subpackage is that if you modify theRecord
in a non-breaking way (add a field at the bottom of the struct), then those changes must be made inlog15.v2
, even if the most recent log15 version is actually at v4. And it's also a bit strange thatlog15.v{3,4,5}/record
are never used..So another solution might be to create a new repo
inconshreveable/log15record
(package record
) that starts at v1, and when breaking changes are made moves to v2..In both cases,
Lvl
andRecordKeyNames
must also move to the new package.Ctx
doesn't necessarily have to move because on the record the field type for the context is []interface{}, but if log15.Ctx is used by third-party projects (I don't know if that's the case), it might move torecord.Ctx
as well to solve the same incompatibility problem.The text was updated successfully, but these errors were encountered: