Skip to content

Allow importing into other Go projects#1

Closed
rwinkhart wants to merge 1 commit intohymkor:masterfrom
rwinkhart:master
Closed

Allow importing into other Go projects#1
rwinkhart wants to merge 1 commit intohymkor:masterfrom
rwinkhart:master

Conversation

@rwinkhart
Copy link
Copy Markdown

This PR splits lispect into two packages to allow importing and using it as a module in other Go projects.

For work, I needed to add a feature to a Go CLI app that does some CLI automation. Lispect works great, but I need to be able to share my program with colleagues without requiring them to install any external dependencies.

Luckily, lispect was written in a way where all that is needed to allow it to be used as a Go module is to split the core functionality out of the main package.

If you find any part of this PR suboptimal, please let me know! The way I've implemented it should have zero impact on the previous intended functionality of lispect as a standalone program.

@hymkor
Copy link
Copy Markdown
Owner

hymkor commented May 3, 2025

Hi @rwinkhart,

Thank you very much for this PR — it's very well thought out, and I completely understand and agree with your motivation. I'm glad to hear that Lispect has been useful in your project.

The idea of splitting the project into two packages makes perfect sense, and I really appreciate how carefully you've implemented the change to preserve backward compatibility.

That said, I have a slightly different convention for organizing packages in this repository:

  • The main package lives in cmd/lispect, and
  • The core functionality remains at the root of the module (github.com/hymkor/lispect) and is used as the lispect package.

I feel this structure keeps the import path cleaner for those who want to use Lispect as a library.

I’d prefer to adapt your changes myself to follow this layout — you've already done the hard part, and I wouldn’t want to trouble you with additional tweaks, especially since the Makefile can be a bit messy.

Thanks again for your thoughtful contribution. I’ll make the adjustments on my end and credit your PR appropriately.

— HAYAMA_Kaoru

@hymkor
Copy link
Copy Markdown
Owner

hymkor commented May 3, 2025

I’ll go ahead and make the adjustments on my end shortly.

@hymkor
Copy link
Copy Markdown
Owner

hymkor commented May 3, 2025

Thank you again for the suggestion.

Although I didn't merge this pull request directly, your code and use case were very helpful in reconsidering the structure of the project. Based on that, I released v0.5.0, which includes package modularization and other improvements.

I truly appreciate your contribution!

@rwinkhart
Copy link
Copy Markdown
Author

Thank you for being so responsive and receptive! I really appreciate your work on this project and your willingness to not discard a PR that changes the structure of the project.

I'm very happy to see the changes have already been made and are in a tagged release. This makes lispect infinitely more useful for me!

@rwinkhart rwinkhart closed this May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants