# \#main

**URL:** https://discourse.julialang.org/tag/main/1715.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Prevent Pkg.test from executing parent's \`@main\` function](https://discourse.julialang.org/t/prevent-pkg-test-from-executing-parents-main-function/134617)

<div class="topic-metadata">

**Author:** [@alametti](https://discourse.julialang.org/u/alametti)\
**Replies:** 3\
**Last updated:** [December 17, 2025, 7:28pm UTC](https://discourse.julialang.org/t/prevent-pkg-test-from-executing-parents-main-function/134617 "2025-12-17T19:28:06Z")

</div>

When I test a local package using the test instruction in the Pkg REPL, the function called by the @main macro gets executed after the tests. For example: src/Foo.jl: module Foo main() = println("hello from main func…

---

## [Optimization of the use of observables and globals in Makie (from script to @main function)](https://discourse.julialang.org/t/optimization-of-the-use-of-observables-and-globals-in-makie-from-script-to-main-function/124258)

<div class="topic-metadata">

**Author:** [@oscarvdvelde](https://discourse.julialang.org/u/oscarvdvelde)\
**Replies:** 3\
**Last updated:** [December 29, 2024, 8:54pm UTC](https://discourse.julialang.org/t/optimization-of-the-use-of-observables-and-globals-in-makie-from-script-to-main-function/124258 "2024-12-29T20:54:33Z")

</div>

I am trying to make my Makie GUI run faster and allocate less. I have just upgraded to Julia 1.11.2 and thought it was a good opportunity to use function (@main) in other words, wrap all my global scope code into a funct…
