-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Package import structure of maths unclear #693
Comments
Thinking about it a bit more - I think it just didn't click in my head that what I name my go mod at the root project level had the effect of defining package paths. I ended up deleting my local go mod and go work files from the This allowed me in the test file to use Anyway, all this to say - I'm nitpicking. This tutorial has been so wonderfully self sufficient, and this was my first real hiccup. It would be cool to smooth over, and I wonder if that happens in ch. 1? |
thank you for this! this helped me moved forward in this chapter. i was stuck for ages at the start of this chapter because I couldn't make heads or tails of how my local folder should be set up. I even downloaded the example source and couldn't figure out how to reflect the changes in my local code. |
This stopped working during the second phase of this chapter:
I notice the code in the second phase doesn't prefix the functions with here is my code, currently:
changing it to start with a capital letter and changing it to |
Thanks for the clues. After spending most of the morning searching for a solution, I came up with this approach based on part 5 of the go.dev tutorial Call your code from another modue. Here we can create two modules, one for testing and one for our clock. Then connect the clock module to the test module using a Note that the tutorial recommends that Steps to replicate
We need to replace the
Matching the first error for the tutorial. Final thoughtsThis is a fantastic course and this is the only time that I really got stuck. A chapter on modules and packages would be a great precursor to the Math section. Hope this helps. |
Digging around, I see there's been some conversation about how the package titles suddenly changed, and we now have two packages, one called
package clockface
and one calledpackage clockface_test
. The sample online has theprojectpath
as a GitHub URL, which may be normal but up to this point, we haven't been introduced to this style of import.I ended up making it work with both a
go mod init clockface
and ago work init .
which got my linter to play nice, but I'm not 100% sure on what I did.I think if you're going to change up the import style from what's been consistent before this chapter, an explanation and instruction is called for, especially for those of us using this track to learn Go for the first time.
THANK YOU all! This has been a wonderful experience so far
The text was updated successfully, but these errors were encountered: