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

Substitute pkg/ with internal/ #398

Open
runcom opened this Issue Feb 9, 2019 · 6 comments

Comments

Projects
None yet
3 participants
@runcom
Copy link
Member

runcom commented Feb 9, 2019

Code within pkg/ here is by no mean intended to be used outside of this project. Since Go 1.4 we can move everything under pkg/ to internal/ so we can only use our stuff and nobody else could vendor and use it (that's our code and not intended to be imported anyway). Go enforces it of course https://golang.org/doc/go1.4#internalpackages

I'm also trying to understand if code under lib/ is just a fork, or it's properly vendored with dep or whatever. In case it's not, we need to work that out to make into vendor as well if it's reusable code. Of course, lib/ is also meant to be used by just ourselves so move it under internal/ as well

@ashcrow

This comment has been minimized.

Copy link
Member

ashcrow commented Feb 11, 2019

👍 to moving to internal.

I don't believe lib/ is vendored.

@runcom

This comment has been minimized.

Copy link
Member Author

runcom commented Feb 11, 2019

I don't believe lib/ is vendored.

too bad, worth understanding why is that and how we can move to that direction instead of using forks

@ashcrow

This comment has been minimized.

Copy link
Member

ashcrow commented Feb 11, 2019

@abhinavdahiya

This comment has been minimized.

Copy link
Member

abhinavdahiya commented Feb 11, 2019

Code within pkg/ here is by no mean intended to be used outside of this project.

The following packages are most definitely supposed to be used outside this project.

  • pkg/apis
  • pkg/generated
  • /pkg/controller/common/constants.go
  • pkg/daemon/constants/constants.go

while these can be used outside:

  • pkg/daemon/rpm-ostree.go
@runcom

This comment has been minimized.

Copy link
Member Author

runcom commented Feb 11, 2019

cool, much better to have that picture now, thanks @abhinavdahiya

@runcom

This comment has been minimized.

Copy link
Member Author

runcom commented Feb 11, 2019

@abhinavdahiya though, what about lib/? is there something we can follow through vendor or does it need to stay forked for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment