format go code

This commit is contained in:
yuli
2024-08-06 18:39:40 +03:00
parent 8b2cd99cce
commit 67cfade5e5
17 changed files with 92 additions and 90 deletions

View File

@@ -2,10 +2,10 @@ package main
import (
"fmt"
"time"
"strings"
"net/http/httptest"
"strings"
"testing"
"time"
)
func helpGetExpStatus(utoken string) (map[string]interface{}, error) {

View File

@@ -5,6 +5,7 @@ import (
"net"
"net/http"
"strings"
"github.com/gobuffalo/packr"
"github.com/oschwald/geoip2-golang"
)
@@ -14,7 +15,6 @@ var (
geoip *geoip2.Reader
)
func initGeoIP() {
var err error
box := packr.NewBox("../ui")

View File

@@ -20,8 +20,10 @@ var userSchema *jsonschema.Schema
// IsAdmin - admin/DPO approval is required
type IsAdmin bool
// IsLocked - variable is locked from changes
type IsLocked bool
// IsPreserve variable can never be deleted
type IsPreserve bool

View File

@@ -178,6 +178,7 @@ func (dbobj *SQLiteDB) CloseDB() {
func (dbobj SQLiteDB) BackupDB(w http.ResponseWriter) {
/*
err := sqlite3dump.DumpDB(dbobj.db, w)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
log.Printf("error in backup: %s", err)

View File

@@ -1,13 +1,13 @@
package main
import (
"net/http/httptest"
"encoding/json"
"net/http/httptest"
"strings"
"testing"
uuid "github.com/hashicorp/go-uuid"
jsonpatch "github.com/evanphx/json-patch"
uuid "github.com/hashicorp/go-uuid"
)
func helpCreateUserApp(userTOKEN string, appName string, appJSON string) (map[string]interface{}, error) {

View File

@@ -454,7 +454,6 @@ func (dbobj dbcon) dumpUserPII(email string, conf Config) (string, error) {
return fullJSON, err
}
func (dbobj dbcon) getUserJSONByIndex(indexValue string, indexName string, conf Config) ([]byte, string, error) {
userBson, err := dbobj.lookupUserRecordByIndex(indexName, indexValue, conf)
if userBson == nil || err != nil {

View File

@@ -1,14 +1,14 @@
package main
import (
"log"
"encoding/json"
"log"
"net/http/httptest"
"strings"
"testing"
uuid "github.com/hashicorp/go-uuid"
jsonpatch "github.com/evanphx/json-patch"
uuid "github.com/hashicorp/go-uuid"
)
func helpCreateUser(userJSON string) (map[string]interface{}, error) {

View File

@@ -2,8 +2,8 @@ package main
import (
"fmt"
"log"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"strings"