gleam-lang / website

🏡 Gleam's website and guide

Home Page:https://gleam.run

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Testing your code" section could use a little more explicit directions.

shaleh opened this issue · comments

I was following along and then ran into:

error: Unknown module

import vars/internal
^^^^^^^^^^^^^^^^^^ Did you mean `argv`?

Which was a little confusing. I was staring right at internal.gleam. Why is it suggesting argv??

Anyways, I got it working by removing the "vars/" part. Total noob here. Just exploring.
I know I must be missing something so I re-read it like 3 more times. Finally I noticed that internal.gleam needs to be in a subdirectory called vars.... which is a bit of a stutter. I am in a package called vars, with a src/vars.gleam and now I need to make another directory called vars?? Ok sure. so I have vars/src/vars/internal.gleam.

Sorry, that turned into more of a rant than I intended.

The intro tutorial should be more explicit.

To call the format_pair function from a module in the test/ directory we will need to make it public. We don’t want it to be part of the public API of the package, so we’ll move it to an internal module, which by default are modules named packagename/internal and packagename/internal/*.

I was thinking I did make packagename/internal. Because vars/src would be a package right?? Nope. The doc should say "make the directory src/vars and put internal.gleam in there".

Hello! Thanks for the report. The guide specifies the exact path to use so let's leave it as is and see how it turns out.