-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Go quiz with impossible question #6951
Comments
No, the import statement import "github/gin-gonic/gin" is not correct in Go. It's missing the .com part in the domain. |
No, I can do:
Then I can make the subdirectory:
Now the code in that directory will be importable with github/gin-gonic/gin |
While that's a clever way to make the specific case work, that won't always be valid, and if its not always valid, it's invalid - think about a tautology from discrete mathematics. |
You can say the same about the correct answer. If the owner takes the repository down it will no longer be a valid import. Both are circumstantial. |
Today it is valid though. If the day comes that the repository is renamed/archived, yes, you will then be correct at that point in time. If you argued this question on an exam, I think the professor would give you at least partial credit, but I think its pretty cut and dry here. Appreciate the outside the box thinking though! |
IMO a bad question. It requires knowing that this repository exists to properly answer. And again, today my answer is correct. No difference |
I'm submitting an ISSUE: please check one with "x"
The following question:
Q6. Which is the only valid import statement in Go?
Import in GoLang
has 2 correct answers. Technically, the first one is also correct for a package named github (go mod init github). Inside this package there could be a subdirectory gin-gonic/gin. This could then be imported with the given import statement.
The text was updated successfully, but these errors were encountered: