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

Go quiz with impossible question #6951

Open
2 of 10 tasks
jordan-bonecutter opened this issue Dec 2, 2023 · 6 comments
Open
2 of 10 tasks

Go quiz with impossible question #6951

jordan-bonecutter opened this issue Dec 2, 2023 · 6 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jordan-bonecutter
Copy link

I'm submitting an ISSUE: please check one with "x"

  • New question{'s}
  • New assessment
  • Missed questions/answers
  • Request for new quiz/answers/...
  • Documentation issue or request for ...
  • ...

The following question:

Q6. Which is the only valid import statement in Go?

  • ­
      import "github/gin-gonic/gin"
  • ­
      import "https://github.com/gin-gonic/gin"
  • ­
      import "../template"
  • ­
      import "github.com/gin-gonic/gin"

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.

@Ebazhanov Ebazhanov added help wanted Extra attention is needed good first issue Good for newcomers labels Dec 7, 2023
@haxkd
Copy link
Contributor

haxkd commented Dec 12, 2023

No, the import statement import "github/gin-gonic/gin" is not correct in Go. It's missing the .com part in the domain.

@jordan-bonecutter
Copy link
Author

No, I can do:

go mod init github

Then I can make the subdirectory:

gin-gonic/gin

Now the code in that directory will be importable with github/gin-gonic/gin

@chrishalbert
Copy link

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.

@jordan-bonecutter
Copy link
Author

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.

@chrishalbert
Copy link

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!

@jordan-bonecutter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants