From b42b76d1d4c5a6bd38d054e5ce66bf8b28a1da2f Mon Sep 17 00:00:00 2001 From: early Date: Mon, 2 Sep 2024 13:24:20 -0600 Subject: [PATCH] add SetNotEligible for emergencies --- include/callstack.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/callstack.go b/include/callstack.go index e006993..3e889df 100644 --- a/include/callstack.go +++ b/include/callstack.go @@ -16,6 +16,14 @@ var callStackNotEligible = []string{ "git.earlybird.gay/today-engine/include", } +// SetNotEligible marks a package as ineligible for including files. +// You should use the arguments of include to to this if you can, but if you are +// using a package that passes through to include, you can call this in an init +// function. +func SetNotEligible(pkg string) { + callStackNotEligible = append(callStackNotEligible, pkg) +} + func isNotEligible(caller string, ignorePackages []string) bool { return slices.ContainsFunc(callStackNotEligible, func(notEligible string) bool { return strings.HasPrefix(caller, notEligible+".") -- 2.39.5