Skip to content
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

Regarding refactoring of solutions in multiple files as opposed to just single file #101

Open
Bigguysahaj opened this issue Sep 7, 2024 · 3 comments
Assignees

Comments

@Bigguysahaj
Copy link

Bigguysahaj commented Sep 7, 2024

At one point of the solution, it just seems ideal to refactor and distribute the codes into various files.
But testing of these files are not supported.

In my case where I'm using go , I have to keep all my code within main.go.
The reason to my understanding is the following code in your_program.sh.

 # this is the current included code
 go build -o /tmp/codecrafters-build-grep-go cmd/mygrep/main.go
 # something like this would be more helpful
 go build -o /tmp/codecrafters-build-grep-go ./cmd/mygrep/...

I would like to know if this behavior of keeping all the code in just one file is by design, and if so what is the main idea behind it?

@rohitpaulk
Copy link
Member

@Bigguysahaj not by design! Seems like a bug in fact, we do suggest splitting out files in
https://docs.codecrafters.io/challenges/language-support/go.

@rohitpaulk
Copy link
Member

We'll take a look at this! In the meantime, you should be able to change the files in .codecrafters/{compile/run}.sh to get the tester to include your files.

@rohitpaulk
Copy link
Member

(will probably get to this next week or the week after)

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

No branches or pull requests

3 participants