]> git.earlybird.gay Git - today/commitdiff
add SetNotEligible for emergencies
authorearly <me@earlybird.gay>
Mon, 2 Sep 2024 19:24:20 +0000 (13:24 -0600)
committerearly <me@earlybird.gay>
Mon, 2 Sep 2024 19:24:20 +0000 (13:24 -0600)
include/callstack.go

index e006993834a51c771ff207c8dda6ff87699fb0eb..3e889df951c4f2b8b54f4c777ddf0177799799f0 100644 (file)
@@ -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+".")