From ea858b8a7bf83999a16faf8b4709e73c0e7e6a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Tikvi=C4=87?= Date: Mon, 28 Nov 2016 10:15:44 +0100 Subject: [PATCH] refactoring --- auth_utility.go | 2 +- format_utility.go | 2 +- http_utility.go | 2 +- json_utility.go | 2 +- list_config.go | 2 +- select_config.go | 2 +- sql_sequrity.go | 11 ++++++----- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/auth_utility.go b/auth_utility.go index ed4b769..b15f7e2 100644 --- a/auth_utility.go +++ b/auth_utility.go @@ -1,4 +1,4 @@ -package restutility +package webutility import ( "errors" diff --git a/format_utility.go b/format_utility.go index 4e8d643..e3edd0a 100644 --- a/format_utility.go +++ b/format_utility.go @@ -1,4 +1,4 @@ -package restutility +package webutility import ( "time" diff --git a/http_utility.go b/http_utility.go index 2c12141..5c26b5c 100644 --- a/http_utility.go +++ b/http_utility.go @@ -1,4 +1,4 @@ -package restutility +package webutility import ( "net/http" diff --git a/json_utility.go b/json_utility.go index 5ce4f01..3edf694 100644 --- a/json_utility.go +++ b/json_utility.go @@ -1,4 +1,4 @@ -package restutility +package webutility import ( "net/http" diff --git a/list_config.go b/list_config.go index 7810bbb..785c807 100644 --- a/list_config.go +++ b/list_config.go @@ -1,4 +1,4 @@ -package restutility +package webutility import ( "gopkg.in/rana/ora.v3" diff --git a/select_config.go b/select_config.go index 3b99462..2e04bde 100644 --- a/select_config.go +++ b/select_config.go @@ -1,4 +1,4 @@ -package restutility +package webutility import ( "gopkg.in/rana/ora.v3" diff --git a/sql_sequrity.go b/sql_sequrity.go index be2cb5e..db9af9b 100644 --- a/sql_sequrity.go +++ b/sql_sequrity.go @@ -1,13 +1,14 @@ -package restutility +package webutility import ( "strings" ) -func SQLSafeString(in string) string { - patern := "\"';&*<>=\\`:" +var patern string = "\"';&*<>=\\`:" + +func SQLSafeString(s string) string { for _, c := range patern { - in = strings.Replace(in, string(c), "", -1) + s = strings.Replace(s, string(c), "", -1) } - return in + return s } -- 1.8.1.2