You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 called package clockface_test. The sample online has the projectpath 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 a go 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:
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 maths dir and edited my go.mod at the root (in my case, go_with_tests/) to say "module go_with_tests"
This allowed me in the test file to use import "go_with_tests/maths"
given that I had a file clock.go with package clockface at the top of the file.
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?
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: