From f00614580982b9260d519514e6f25bfc746f7975 Mon Sep 17 00:00:00 2001 From: Bankole Ojo Date: Tue, 12 Sep 2023 12:38:40 +0100 Subject: [PATCH] removed unneeded code --- flaarum_shared/lib.go | 49 +------------------------------------------ 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/flaarum_shared/lib.go b/flaarum_shared/lib.go index b0e2f02..8a9fa8d 100644 --- a/flaarum_shared/lib.go +++ b/flaarum_shared/lib.go @@ -15,10 +15,7 @@ import ( ) const ( - DATE_FORMAT = "2006-01-02" - DATETIME_FORMAT = "2006-01-02T15:04 MST" - STRING_MAX_LENGTH = 100 - PORT = 22318 + PORT = 22318 ) var RootConfigTemplate = `// debug can be set to either false or true @@ -203,49 +200,5 @@ func GetFieldType(projName, tableName, fieldName string) string { fieldNamesToFieldTypes[fieldStruct.FieldName] = fieldStruct.FieldType } - if strings.HasSuffix(fieldName, "_year") { - genFieldName := fieldName[0 : len(fieldName)-len("_year")] - ans, ok := fieldNamesToFieldTypes[genFieldName] - - if ok && (ans == "datetime" || ans == "date") { - return "int" - } - } else if strings.HasSuffix(fieldName, "_month") { - genFieldName := fieldName[0 : len(fieldName)-len("_month")] - ans, ok := fieldNamesToFieldTypes[genFieldName] - - if ok && (ans == "datetime" || ans == "date") { - return "int" - } - } else if strings.HasSuffix(fieldName, "_day") { - genFieldName := fieldName[0 : len(fieldName)-len("_day")] - ans, ok := fieldNamesToFieldTypes[genFieldName] - - if ok && (ans == "datetime" || ans == "date") { - return "int" - } - } else if strings.HasSuffix(fieldName, "_hour") { - genFieldName := fieldName[0 : len(fieldName)-len("_hour")] - ans, ok := fieldNamesToFieldTypes[genFieldName] - - if ok && ans == "datetime" { - return "int" - } - } else if strings.HasSuffix(fieldName, "_date") { - genFieldName := fieldName[0 : len(fieldName)-len("_date")] - ans, ok := fieldNamesToFieldTypes[genFieldName] - - if ok && ans == "datetime" { - return "date" - } - } else if strings.HasSuffix(fieldName, "_tzname") { - genFieldName := fieldName[0 : len(fieldName)-len("_tzname")] - ans, ok := fieldNamesToFieldTypes[genFieldName] - - if ok && ans == "datetime" { - return "string" - } - } - return fieldNamesToFieldTypes[fieldName] }