]> saetta.ns0.it Git - zakegg_go/commitdiff
Modifiche per debian/buster. debian/buster
authorAndrea Zagli <azagli@libero.it>
Fri, 12 Aug 2022 06:52:22 +0000 (08:52 +0200)
committerAndrea Zagli <azagli@libero.it>
Fri, 12 Aug 2022 06:52:22 +0000 (08:52 +0200)
form.go
go.mod

diff --git a/form.go b/form.go
index 4b915062cb2e38c552ed8cdffd4b5f5484eaea82..da06cc38fb8c36499e36b22b4a499a8d97a1453b 100644 (file)
--- a/form.go
+++ b/form.go
@@ -153,7 +153,7 @@ func Map2FormElements(s map[string]interface{}, f map[string]*FormElement) {
                                        }
                                } else if refv.Kind() == reflect.Float32 || refv.Kind() == reflect.Float64 {
                                        vg.Value = fmt.Sprintf("%v", v)
-                                       vg.Value = strings.ReplaceAll(vg.Value, ".", ",")
+                                       vg.Value = strings.Replace(vg.Value, ".", ",", -1)
                                /* TODO */
                                } else if strings.Contains(vg.Validation, "mydate") {
                                        vg.Value = v.(time.Time).Format("02/01/2006")
@@ -205,8 +205,8 @@ func CreaMapDb (elems map[string]*FormElement) (map[string]interface{}) {
                if elem.DBName != "" {
                        if strings.Contains(elem.Validation, "numeric_it") {
                                /* tolgo la formattazione */
-                               campi[elem.DBName] = strings.ReplaceAll(elem.Value, ".", "")
-                               campi[elem.DBName] = strings.ReplaceAll(campi[elem.DBName].(string), ",", ".")
+                               campi[elem.DBName] = strings.Replace(elem.Value, ".", "", -1)
+                               campi[elem.DBName] = strings.Replace(campi[elem.DBName].(string), ",", ".", -1)
                        } else if strings.Contains(elem.Validation, "mydate") && elem.Value != "" {
                                /* metto la data in formato sql */
                                t, err := time.Parse("02/01/2006", elem.Value)
diff --git a/go.mod b/go.mod
index 4d462651e90e7f57c7abb54e8c2133fab8a12d46..0a2a99201325a91993db04a499dcaa301a2ed471 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module saetta.ns0.it/git/zakegg_go.git
 
-go 1.18
+go 1.11
 
 require (
        github.com/feiin/sqlstring v0.3.0
@@ -9,10 +9,4 @@ require (
        github.com/squeeze69/codicefiscale v1.0.2
 )
 
-require (
-       github.com/go-playground/locales v0.14.0 // indirect
-       github.com/leodido/go-urn v1.2.1 // indirect
-       golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
-       golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect
-       golang.org/x/text v0.3.7 // indirect
-)
+replace github.com/feiin/sqlstring => ../sqlstring