Giter Club home page Giter Club logo

Comments (16)

snprajwal avatar snprajwal commented on July 24, 2024 2

It would be hard to give a yes or no depending on just the directory structure - the contents of the files matters too. I would suggest opening a draft PR with the work, and we can iterate and make the appropriate changes :)

from checkpointctl.

snprajwal avatar snprajwal commented on July 24, 2024 1

@shikharish it would mainly require creating a cmd package and moving the commands into individual files under that package, i.e. the show() and setupShow() functions would go in show.go, similarly with inspect.go, and the remaining functions under util.go. This package can be imported in the existing checkpointctl.go file and used in the main function.

from checkpointctl.

snprajwal avatar snprajwal commented on July 24, 2024 1

I can't use the functions from controller.go and memparse.go(which are in the main package) in cmd package.

Ah, I assumed you were asking about whether those files should be split up into smaller components. Yes, the files should be moved, but not into cmd. Placing them in the existing lib package is more appropriate.

from checkpointctl.

shikharish avatar shikharish commented on July 24, 2024

Hello @snprajwal, what is the status of this issue? Can I work on this?

from checkpointctl.

snprajwal avatar snprajwal commented on July 24, 2024

This is not actively being worked on - do feel free to take it up!

from checkpointctl.

shikharish avatar shikharish commented on July 24, 2024

@snprajwal Thanks! Pls assign me this.
Also, can you pls explain the issue a bit more. What things should I keep in mind while refactoring?

from checkpointctl.

shikharish avatar shikharish commented on July 24, 2024

@snprajwal Should I also move container.go and memparse.go to cmd pacakge as they will be used in show.go, inspect.go and utils.go.

from checkpointctl.

snprajwal avatar snprajwal commented on July 24, 2024

IMO, it would be better to leave those files as is for now. If necessary, they can be split up in a separate PR going forward.

from checkpointctl.

shikharish avatar shikharish commented on July 24, 2024

IMO, it would be better to leave those files as is for now. If necessary, they can be split up in a separate PR going forward.

@snprajwal I mean I can't use the functions from controller.go and memparse.go(which are in the main package) in cmd package. Because we cannot import the main package as far as I know.

from checkpointctl.

adrianreber avatar adrianreber commented on July 24, 2024

About lib/. That is currently included in a couple of projects and basically has no external dependencies. This is a bit unfortunate that the lib/ namespace is blocked, but I just wanted to highlight that it needs to be in a different directory so that projects including lib/metadata.go do not get additional dependencies pulled in.

from checkpointctl.

snprajwal avatar snprajwal commented on July 24, 2024

In that case, how about internal? These files shouldn't be accessed by an external entity as a dependency anyway, it's purely for use within checkpointctl

from checkpointctl.

adrianreber avatar adrianreber commented on July 24, 2024

In that case, how about internal? These files shouldn't be accessed by an external entity as a dependency anyway, it's purely for use within checkpointctl

That should work. internal/ is a special name if I remember correctly and cannot be included in other projects, right? But if that will be a problem it can be renamed.

from checkpointctl.

shikharish avatar shikharish commented on July 24, 2024

Hello, am working on this. It is a bit more complicated then I expected it to be. A lot of files have to moved and changed. Would need some more time. This is the directory structure right now:

cmd
├── inspect.go
├── memparse.go
└── show.go

internal
├── container.go
├── tree.go
├── utils.go
└── utils_test.go

lib
└── metadata.go

checkpointctl.go

Please review whether this is appropriate.

from checkpointctl.

shikharish avatar shikharish commented on July 24, 2024

@snprajwal @adrianreber

from checkpointctl.

adrianreber avatar adrianreber commented on July 24, 2024

I agree. Open a PR and let's discuss your work there. Having the actual changes makes the discussion much easier.

from checkpointctl.

shikharish avatar shikharish commented on July 24, 2024

@snprajwal Opened a draft PR.

from checkpointctl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.