# Pass local module to a function?

**URL:** <https://discourse.julialang.org/t/pass-local-module-to-a-function/40021>\
**Category:** General Usage\
**Tags:** documenter, module\
**Created:** [May 23, 2020, 1:48pm UTC](https://discourse.julialang.org/t/pass-local-module-to-a-function/40021 "2020-05-23T13:48:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [May 23, 2020, 1:48pm UTC](https://discourse.julialang.org/t/pass-local-module-to-a-function/40021/1 "2020-05-23T13:48:42Z")

</div>

I’m trying to create a minimal working example of a Documenter error I’m experiencing. However I’m having trouble passing the “local” module to the `doctest` function, This is what I’m trying:

```julia
using Documenter

module Foo

function foo()
end

end

doctest(Foo)

```

I’ve also tried “.Foo”, “…Foo”, “…Foo”, and “Main.Foo”. Is this even possible? Or do I need to create a module somewhere and use Pkg to add it?

---

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [May 23, 2020, 2:01pm UTC](https://discourse.julialang.org/t/pass-local-module-to-a-function/40021/2 "2020-05-23T14:01:47Z")

</div>

I figured it out. It appears you need to do:

```julia
doctest(nothing, [Foo])

```

Looking at the source for Documenter this bypasses the `pathof(package)` code in the other `doctest()` method and it’s happish.
