Fixing FMT errors

Do we run go-fmt in CI?
This commit is contained in:
Denis Makogon
2017-07-28 13:03:47 +03:00
parent 721c0f1255
commit 49fe3eb11a
36 changed files with 43 additions and 43 deletions

View File

@@ -3,9 +3,9 @@ package datastoreutil
import (
"context"
"github.com/fnproject/fn/api/models"
"github.com/jmoiron/sqlx"
"github.com/opentracing/opentracing-go"
"github.com/fnproject/fn/api/models"
)
func MetricDS(ds models.Datastore) models.Datastore {

View File

@@ -2,8 +2,8 @@ package logs
import (
"context"
"github.com/pkg/errors"
"github.com/fnproject/fn/api/models"
"github.com/pkg/errors"
)
type mock struct {

View File

@@ -6,9 +6,9 @@ import (
"testing"
"time"
"github.com/go-openapi/strfmt"
"github.com/fnproject/fn/api/id"
"github.com/fnproject/fn/api/models"
"github.com/go-openapi/strfmt"
)
var testApp = &models.App{

View File

@@ -10,9 +10,9 @@ import (
"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/fnproject/fn/api/models"
)
type assoc struct {

View File

@@ -8,9 +8,9 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/google/btree"
"github.com/fnproject/fn/api/models"
"github.com/fnproject/fn/api/runner/common"
"github.com/google/btree"
)
type MemoryMQ struct {

View File

@@ -7,8 +7,8 @@ import (
"strings"
"github.com/Sirupsen/logrus"
"github.com/opentracing/opentracing-go"
"github.com/fnproject/fn/api/models"
"github.com/opentracing/opentracing-go"
)
// New will parse the URL and return the correct MQ implementation.

View File

@@ -10,9 +10,9 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/garyburd/redigo/redis"
"github.com/fnproject/fn/api/models"
"github.com/fnproject/fn/api/runner/common"
"github.com/garyburd/redigo/redis"
)
type RedisMQ struct {

View File

@@ -14,13 +14,13 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"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/fnproject/fn/api/runner/drivers"
"github.com/fnproject/fn/api/runner/task"
"github.com/gin-gonic/gin"
)
func setLogBuffer() *bytes.Buffer {

View File

@@ -15,11 +15,11 @@ import (
"github.com/Sirupsen/logrus"
manifest "github.com/docker/distribution/manifest/schema1"
"github.com/fnproject/fn/api/runner/common"
"github.com/fnproject/fn/api/runner/drivers"
"github.com/fsouza/go-dockerclient"
"github.com/heroku/docker-registry-client/registry"
"github.com/opentracing/opentracing-go"
"github.com/fnproject/fn/api/runner/common"
"github.com/fnproject/fn/api/runner/drivers"
)
const hubURL = "https://registry.hub.docker.com"

View File

@@ -13,10 +13,10 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/fnproject/fn/api/runner/common"
"github.com/fsouza/go-dockerclient"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/log"
"github.com/fnproject/fn/api/runner/common"
)
const (

View File

@@ -9,9 +9,9 @@ import (
"testing"
"time"
"github.com/vrischmann/envconfig"
"github.com/fnproject/fn/api/runner/common"
"github.com/fnproject/fn/api/runner/drivers"
"github.com/vrischmann/envconfig"
)
type taskDockerTest struct {

View File

@@ -14,14 +14,14 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/log"
"github.com/fnproject/fn/api/models"
"github.com/fnproject/fn/api/runner/common"
"github.com/fnproject/fn/api/runner/drivers"
"github.com/fnproject/fn/api/runner/drivers/docker"
"github.com/fnproject/fn/api/runner/drivers/mock"
"github.com/fnproject/fn/api/runner/task"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/log"
)
// TODO clean all of this up, the exposed API is huge and incohesive,

View File

@@ -10,9 +10,9 @@ import (
"time"
"github.com/docker/cli/cli/config/configfile"
docker "github.com/fsouza/go-dockerclient"
"github.com/fnproject/fn/api/runner/drivers"
"github.com/fnproject/fn/api/runner/task"
docker "github.com/fsouza/go-dockerclient"
)
var registries dockerRegistries

View File

@@ -9,13 +9,13 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/go-openapi/strfmt"
"github.com/opentracing/opentracing-go"
"github.com/fnproject/fn/api/id"
"github.com/fnproject/fn/api/models"
"github.com/fnproject/fn/api/runner/drivers"
"github.com/fnproject/fn/api/runner/protocol"
"github.com/fnproject/fn/api/runner/task"
"github.com/go-openapi/strfmt"
"github.com/opentracing/opentracing-go"
)
// hot functions - theory of operation

View File

@@ -3,8 +3,8 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api/models"
"github.com/gin-gonic/gin"
)
func (s *Server) handleAppCreate(c *gin.Context) {

View File

@@ -3,10 +3,10 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/fnproject/fn/api/models"
"github.com/fnproject/fn/api/runner/common"
"github.com/gin-gonic/gin"
)
func (s *Server) handleAppDelete(c *gin.Context) {

View File

@@ -3,8 +3,8 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/gin-gonic/gin"
)
func (s *Server) handleAppGet(c *gin.Context) {

View File

@@ -3,8 +3,8 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api/models"
"github.com/gin-gonic/gin"
)
func (s *Server) handleAppList(c *gin.Context) {

View File

@@ -8,11 +8,11 @@ import (
"testing"
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"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"
)
func setLogBuffer() *bytes.Buffer {

View File

@@ -3,9 +3,9 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/fnproject/fn/api/models"
"github.com/gin-gonic/gin"
)
func (s *Server) handleAppUpdate(c *gin.Context) {

View File

@@ -3,8 +3,8 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/gin-gonic/gin"
)
func (s *Server) handleCallGet(c *gin.Context) {

View File

@@ -3,8 +3,8 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/gin-gonic/gin"
)
func (s *Server) handleCallLogGet(c *gin.Context) {

View File

@@ -4,9 +4,9 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/fnproject/fn/api/models"
"github.com/gin-gonic/gin"
)
type ApiHandlerFunc func(w http.ResponseWriter, r *http.Request)

View File

@@ -6,9 +6,9 @@ import (
"path"
"strings"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/fnproject/fn/api/models"
"github.com/gin-gonic/gin"
)
/* handleRouteCreateOrUpdate is used to handle POST PUT and PATCH for routes.

View File

@@ -4,8 +4,8 @@ import (
"net/http"
"path"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/gin-gonic/gin"
)
func (s *Server) handleRouteDelete(c *gin.Context) {

View File

@@ -4,8 +4,8 @@ import (
"net/http"
"path"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/gin-gonic/gin"
)
func (s *Server) handleRouteGet(c *gin.Context) {

View File

@@ -3,9 +3,9 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
"github.com/fnproject/fn/api/models"
"github.com/gin-gonic/gin"
)
func (s *Server) handleRouteList(c *gin.Context) {

View File

@@ -12,15 +12,15 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"github.com/go-openapi/strfmt"
cache "github.com/patrickmn/go-cache"
"github.com/fnproject/fn/api"
"github.com/fnproject/fn/api/id"
"github.com/fnproject/fn/api/models"
"github.com/fnproject/fn/api/runner"
"github.com/fnproject/fn/api/runner/common"
"github.com/fnproject/fn/api/runner/task"
"github.com/gin-gonic/gin"
"github.com/go-openapi/strfmt"
cache "github.com/patrickmn/go-cache"
)
type runnerResponse struct {

View File

@@ -9,12 +9,12 @@ import (
"testing"
"time"
"github.com/gin-gonic/gin"
cache "github.com/patrickmn/go-cache"
"github.com/fnproject/fn/api/datastore"
"github.com/fnproject/fn/api/models"
"github.com/fnproject/fn/api/mqs"
"github.com/fnproject/fn/api/runner"
"github.com/gin-gonic/gin"
cache "github.com/patrickmn/go-cache"
)
func testRouterAsync(ds models.Datastore, mq models.MessageQueue, rnr *runner.Runner, enqueue models.Enqueue) *gin.Engine {

View File

@@ -12,12 +12,12 @@ import (
"testing"
"time"
"github.com/gin-gonic/gin"
cache "github.com/patrickmn/go-cache"
"github.com/fnproject/fn/api/datastore"
"github.com/fnproject/fn/api/models"
"github.com/fnproject/fn/api/mqs"
"github.com/fnproject/fn/api/runner"
"github.com/gin-gonic/gin"
cache "github.com/patrickmn/go-cache"
)
var tmpDatastoreTests = "/tmp/func_test_datastore.db"

View File

@@ -3,8 +3,8 @@ package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api/version"
"github.com/gin-gonic/gin"
)
func handleVersion(c *gin.Context) {

View File

@@ -10,10 +10,10 @@ import (
"path/filepath"
"time"
client "github.com/fnproject/fn/cli/client"
functions "github.com/funcy/functions_go"
"github.com/funcy/functions_go/models"
"github.com/urfave/cli"
client "github.com/fnproject/fn/cli/client"
)
func deploy() cli.Command {

View File

@@ -17,8 +17,8 @@ import (
"strings"
"github.com/urfave/cli"
"github.com/fnproject/fn/cli/langs"
"github.com/urfave/cli"
)
var (

View File

@@ -11,12 +11,12 @@ import (
"strings"
"text/tabwriter"
client "github.com/fnproject/fn/cli/client"
fnclient "github.com/funcy/functions_go/client"
apiroutes "github.com/funcy/functions_go/client/routes"
fnmodels "github.com/funcy/functions_go/models"
"github.com/jmoiron/jsonq"
"github.com/urfave/cli"
client "github.com/fnproject/fn/cli/client"
)
type routesCmd struct {

View File

@@ -12,10 +12,10 @@ import (
"strings"
"time"
"github.com/fnproject/fn/cli/client"
functions "github.com/funcy/functions_go"
"github.com/onsi/gomega"
"github.com/urfave/cli"
"github.com/fnproject/fn/cli/client"
)
type testStruct struct {

View File

@@ -4,8 +4,8 @@ package tests
import (
"testing"
"github.com/funcy/functions_go/models"
"github.com/fnproject/fn/api/id"
"github.com/funcy/functions_go/models"
)
func TestRoutes(t *testing.T) {