From 6ac579f2966a2d273f8382ca00c32945f3e3c36b Mon Sep 17 00:00:00 2001 From: Denis Makogon Date: Tue, 5 Sep 2017 23:11:08 +0300 Subject: [PATCH] Formatting issues Aren't we running go-fmt.sh in CI? --- api/agent/drivers/driver_test.go | 8 +-- api/datastore/internal/datastoretest/test.go | 2 +- api/datastore/sql/sql.go | 52 ++++++++++---------- api/logs/log.go | 2 +- api/mqs/bolt.go | 2 +- api/mqs/ironmq.go | 2 +- api/mqs/new.go | 2 +- api/server/apps_test.go | 2 +- api/server/init.go | 2 +- fnlb/lb/allgrouper.go | 2 +- fnlb/lb/proxy.go | 2 +- fnlb/main.go | 2 +- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/api/agent/drivers/driver_test.go b/api/agent/drivers/driver_test.go index 7c5a84337..f309f8536 100644 --- a/api/agent/drivers/driver_test.go +++ b/api/agent/drivers/driver_test.go @@ -94,14 +94,14 @@ func TestDecimate(t *testing.T) { func TestParseImage(t *testing.T) { cases := map[string][]string{ - "fnproject/hello": {"", "fnproject/hello", "latest"}, - "fnproject/hello:v1": {"", "fnproject/hello", "v1"}, + "fnproject/hello": {"", "fnproject/hello", "latest"}, + "fnproject/hello:v1": {"", "fnproject/hello", "v1"}, "my.registry/hello": {"my.registry", "hello", "latest"}, "my.registry/hello:v1": {"my.registry", "hello", "v1"}, "mongo": {"", "library/mongo", "latest"}, "mongo:v1": {"", "library/mongo", "v1"}, - "quay.com/fnproject/hello": {"quay.com", "fnproject/hello", "latest"}, - "quay.com:8080/fnproject/hello:v2": {"quay.com:8080", "fnproject/hello", "v2"}, + "quay.com/fnproject/hello": {"quay.com", "fnproject/hello", "latest"}, + "quay.com:8080/fnproject/hello:v2": {"quay.com:8080", "fnproject/hello", "v2"}, "localhost.localdomain:5000/samalba/hipache:latest": {"localhost.localdomain:5000", "samalba/hipache", "latest"}, } diff --git a/api/datastore/internal/datastoretest/test.go b/api/datastore/internal/datastoretest/test.go index 84e95ef0b..144f50779 100644 --- a/api/datastore/internal/datastoretest/test.go +++ b/api/datastore/internal/datastoretest/test.go @@ -13,9 +13,9 @@ import ( "reflect" "time" - "github.com/sirupsen/logrus" "github.com/gin-gonic/gin" "github.com/go-openapi/strfmt" + "github.com/sirupsen/logrus" ) func setLogBuffer() *bytes.Buffer { diff --git a/api/datastore/sql/sql.go b/api/datastore/sql/sql.go index 70f88b392..9baf8232d 100644 --- a/api/datastore/sql/sql.go +++ b/api/datastore/sql/sql.go @@ -12,7 +12,6 @@ import ( "path/filepath" "strings" - "github.com/sirupsen/logrus" "github.com/fnproject/fn/api/models" "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql" @@ -21,6 +20,7 @@ import ( _ "github.com/lib/pq" "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3" + "github.com/sirupsen/logrus" ) // this aims to be an ANSI-SQL compliant package that uses only question @@ -71,23 +71,23 @@ const ( ) type sqlStore struct { - db *sqlx.DB - insertAppQuery string - updateAppQuery string - getAppQuery string + db *sqlx.DB + insertAppQuery string + updateAppQuery string + getAppQuery string selectAppConfigQuery string - removeAppQuery string - insertRouteQuery string - updateRouteQuery string - checkRouteAppQuery string - checkRouteQuery string - getRouteQuery string - removeRouteQuery string - insertCallQuery string - getCallQuery string - insertLogQuery string - getLogQuery string - deleteLogQuery string + removeAppQuery string + insertRouteQuery string + updateRouteQuery string + checkRouteAppQuery string + checkRouteQuery string + getRouteQuery string + removeRouteQuery string + insertCallQuery string + getCallQuery string + insertLogQuery string + getLogQuery string + deleteLogQuery string } // New will open the db specified by url, create any tables necessary @@ -147,14 +147,14 @@ func New(url *url.URL) (models.Datastore, error) { } dstore := &sqlStore{ - db: db, - insertAppQuery: db.Rebind("INSERT INTO apps (name, config) VALUES (?, ?);"), + db: db, + insertAppQuery: db.Rebind("INSERT INTO apps (name, config) VALUES (?, ?);"), selectAppConfigQuery: db.Rebind(`SELECT config FROM apps WHERE name=?`), - updateAppQuery: db.Rebind(`UPDATE apps SET config=? WHERE name=?`), - removeAppQuery: db.Rebind(`DELETE FROM apps WHERE name = ?`), - getAppQuery: db.Rebind(`SELECT name, config FROM apps WHERE name=?`), - checkRouteAppQuery: db.Rebind(`SELECT 1 FROM apps WHERE name=?`), - checkRouteQuery: db.Rebind(`SELECT 1 FROM routes WHERE app_name=? AND path=?`), + updateAppQuery: db.Rebind(`UPDATE apps SET config=? WHERE name=?`), + removeAppQuery: db.Rebind(`DELETE FROM apps WHERE name = ?`), + getAppQuery: db.Rebind(`SELECT name, config FROM apps WHERE name=?`), + checkRouteAppQuery: db.Rebind(`SELECT 1 FROM apps WHERE name=?`), + checkRouteQuery: db.Rebind(`SELECT 1 FROM routes WHERE app_name=? AND path=?`), insertRouteQuery: db.Rebind(`INSERT INTO routes ( app_name, path, @@ -190,9 +190,9 @@ func New(url *url.URL) (models.Datastore, error) { path ) VALUES (?, ?, ?, ?, ?, ?, ?);`), - getCallQuery: db.Rebind(fmt.Sprintf(`%s WHERE id=? AND app_name=?`, callSelector)), + getCallQuery: db.Rebind(fmt.Sprintf(`%s WHERE id=? AND app_name=?`, callSelector)), insertLogQuery: db.Rebind(`INSERT INTO logs (id, log) VALUES (?, ?);`), - getLogQuery: db.Rebind(`SELECT log FROM logs WHERE id=?`), + getLogQuery: db.Rebind(`SELECT log FROM logs WHERE id=?`), deleteLogQuery: db.Rebind(`DELETE FROM logs WHERE id=?`), } return dstore, nil diff --git a/api/logs/log.go b/api/logs/log.go index b5daffa29..e6260d524 100644 --- a/api/logs/log.go +++ b/api/logs/log.go @@ -4,9 +4,9 @@ import ( "fmt" "net/url" - "github.com/sirupsen/logrus" "github.com/fnproject/fn/api/datastore/sql" "github.com/fnproject/fn/api/models" + "github.com/sirupsen/logrus" ) func New(dbURL string) (models.LogStore, error) { diff --git a/api/mqs/bolt.go b/api/mqs/bolt.go index b783554c8..7bcbfe015 100644 --- a/api/mqs/bolt.go +++ b/api/mqs/bolt.go @@ -11,10 +11,10 @@ import ( "path/filepath" "time" - "github.com/sirupsen/logrus" "github.com/boltdb/bolt" "github.com/fnproject/fn/api/common" "github.com/fnproject/fn/api/models" + "github.com/sirupsen/logrus" ) type BoltDbMQ struct { diff --git a/api/mqs/ironmq.go b/api/mqs/ironmq.go index 46b422b35..792289368 100644 --- a/api/mqs/ironmq.go +++ b/api/mqs/ironmq.go @@ -9,10 +9,10 @@ import ( "strings" "sync" - "github.com/sirupsen/logrus" "github.com/fnproject/fn/api/models" mq_config "github.com/iron-io/iron_go3/config" ironmq "github.com/iron-io/iron_go3/mq" + "github.com/sirupsen/logrus" ) type assoc struct { diff --git a/api/mqs/new.go b/api/mqs/new.go index 5b9733e39..0f46af388 100644 --- a/api/mqs/new.go +++ b/api/mqs/new.go @@ -6,9 +6,9 @@ import ( "net/url" "strings" - "github.com/sirupsen/logrus" "github.com/fnproject/fn/api/models" "github.com/opentracing/opentracing-go" + "github.com/sirupsen/logrus" ) // New will parse the URL and return the correct MQ implementation. diff --git a/api/server/apps_test.go b/api/server/apps_test.go index 33627fdfb..18f508164 100644 --- a/api/server/apps_test.go +++ b/api/server/apps_test.go @@ -7,12 +7,12 @@ import ( "strings" "testing" - "github.com/sirupsen/logrus" "github.com/fnproject/fn/api/datastore" "github.com/fnproject/fn/api/logs" "github.com/fnproject/fn/api/models" "github.com/fnproject/fn/api/mqs" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" ) func setLogBuffer() *bytes.Buffer { diff --git a/api/server/init.go b/api/server/init.go index d92d14430..2d2214565 100644 --- a/api/server/init.go +++ b/api/server/init.go @@ -7,8 +7,8 @@ import ( "os/signal" "strings" - "github.com/sirupsen/logrus" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" "github.com/spf13/viper" ) diff --git a/fnlb/lb/allgrouper.go b/fnlb/lb/allgrouper.go index 5e9faf8df..28f825c36 100644 --- a/fnlb/lb/allgrouper.go +++ b/fnlb/lb/allgrouper.go @@ -17,12 +17,12 @@ import ( "time" "fmt" - "github.com/sirupsen/logrus" "github.com/coreos/go-semver/semver" "github.com/go-sql-driver/mysql" "github.com/jmoiron/sqlx" "github.com/lib/pq" "github.com/mattn/go-sqlite3" + "github.com/sirupsen/logrus" ) // NewAllGrouper returns a Grouper that will return the entire list of nodes diff --git a/fnlb/lb/proxy.go b/fnlb/lb/proxy.go index b295dfe07..f8c2b3892 100644 --- a/fnlb/lb/proxy.go +++ b/fnlb/lb/proxy.go @@ -7,11 +7,11 @@ import ( "net/http/httputil" "sync" - "github.com/sirupsen/logrus" "github.com/coreos/go-semver/semver" opentracing "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" "github.com/openzipkin/zipkin-go-opentracing" + "github.com/sirupsen/logrus" ) // TODO the load balancers all need to have the same list of nodes. gossip? diff --git a/fnlb/main.go b/fnlb/main.go index 911529756..a89ed20d0 100644 --- a/fnlb/main.go +++ b/fnlb/main.go @@ -12,9 +12,9 @@ import ( "syscall" "time" - "github.com/sirupsen/logrus" "github.com/coreos/go-semver/semver" "github.com/fnproject/fn/fnlb/lb" + "github.com/sirupsen/logrus" ) const VERSION = "0.0.56"