From: early Date: Mon, 2 Sep 2024 19:24:20 +0000 (-0600) Subject: add SetNotEligible for emergencies X-Git-Url: https://git.earlybird.gay/?a=commitdiff_plain;h=b42b76d1d4c5a6bd38d054e5ce66bf8b28a1da2f;p=today add SetNotEligible for emergencies --- 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+".")