From 4655e74c2a88c6f2fb97dd4d7642436a1268a3b6 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Fri, 23 Oct 2020 16:31:49 -0400 Subject: [PATCH] Minor improvements --- config/config.go | 3 +-- core/condition.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config/config.go b/config/config.go index 6e69da6e..94148300 100644 --- a/config/config.go +++ b/config/config.go @@ -76,9 +76,8 @@ func Load(configFile string) error { if err != nil { if os.IsNotExist(err) { return ErrConfigFileNotFound - } else { - return err } + return err } config = cfg return nil diff --git a/core/condition.go b/core/condition.go index a225372a..7468a3b9 100644 --- a/core/condition.go +++ b/core/condition.go @@ -35,10 +35,16 @@ const ( // Values that could replace the placeholder: true, false ConnectedPlaceHolder = "[CONNECTED]" - LengthFunctionPrefix = "len(" - PatternFunctionPrefix = "pat(" - FunctionSuffix = ")" + // LengthFunctionPrefix is the prefix for the length function + LengthFunctionPrefix = "len(" + // LengthFunctionPrefix is the prefix for the pattern function + PatternFunctionPrefix = "pat(" + + // LengthFunctionPrefix is the suffix for all functions + FunctionSuffix = ")" + + // InvalidConditionElementSuffix is the suffix that will be appended to an invalid condition InvalidConditionElementSuffix = "(INVALID)" )