Skip to content

Commit

Permalink
style(format): code format
Browse files Browse the repository at this point in the history
  • Loading branch information
cg33 committed Jul 9, 2020
1 parent ffed452 commit 45926f1
Show file tree
Hide file tree
Showing 161 changed files with 425 additions and 264 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ lint: fmt golint govet cilint

fmt:
GO111MODULE=off go fmt ./...
GO111MODULE=off goimports -l -w .

govet:
GO111MODULE=off go vet ./...
Expand Down
3 changes: 2 additions & 1 deletion adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package adapter
import (
"bytes"
"fmt"
"net/url"

"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/modules/auth"
"github.com/GoAdminGroup/go-admin/modules/config"
Expand All @@ -18,7 +20,6 @@ import (
"github.com/GoAdminGroup/go-admin/plugins/admin/models"
"github.com/GoAdminGroup/go-admin/template"
"github.com/GoAdminGroup/go-admin/template/types"
"net/url"
)

// WebFrameWork is an interface which is used as an adapter of
Expand Down
7 changes: 4 additions & 3 deletions adapter/beego/beego.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ package beego
import (
"bytes"
"errors"
"net/http"
"net/url"
"strings"

"github.com/GoAdminGroup/go-admin/adapter"
gctx "github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/engine"
Expand All @@ -17,9 +21,6 @@ import (
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/astaxie/beego"
"github.com/astaxie/beego/context"
"net/http"
"net/url"
"strings"
)

// Beego structure value is a Beego GoAdmin adapter.
Expand Down
9 changes: 5 additions & 4 deletions adapter/buffalo/buffalo.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ package buffalo
import (
"bytes"
"errors"
"net/http"
neturl "net/url"
"regexp"
"strings"

"github.com/GoAdminGroup/go-admin/adapter"
"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/engine"
Expand All @@ -16,10 +21,6 @@ import (
"github.com/GoAdminGroup/go-admin/plugins/admin/modules/constant"
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/gobuffalo/buffalo"
"net/http"
neturl "net/url"
"regexp"
"strings"
)

// Buffalo structure value is a Buffalo GoAdmin adapter.
Expand Down
9 changes: 5 additions & 4 deletions adapter/chi/chi.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ package chi
import (
"bytes"
"errors"
"net/http"
"net/url"
"regexp"
"strings"

"github.com/GoAdminGroup/go-admin/adapter"
"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/engine"
Expand All @@ -16,10 +21,6 @@ import (
"github.com/GoAdminGroup/go-admin/plugins/admin/modules/constant"
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/go-chi/chi"
"net/http"
"net/url"
"regexp"
"strings"
)

// Chi structure value is a Chi GoAdmin adapter.
Expand Down
7 changes: 4 additions & 3 deletions adapter/echo/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ package echo
import (
"bytes"
"errors"
"net/http"
"net/url"
"strings"

"github.com/GoAdminGroup/go-admin/adapter"
"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/engine"
Expand All @@ -16,9 +20,6 @@ import (
"github.com/GoAdminGroup/go-admin/plugins/admin/modules/constant"
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/labstack/echo/v4"
"net/http"
"net/url"
"strings"
)

// Echo structure value is an Echo GoAdmin adapter.
Expand Down
9 changes: 5 additions & 4 deletions adapter/fasthttp/fasthttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ package fasthttp
import (
"bytes"
"errors"
"io"
"net/http"
"net/url"
"strings"

"github.com/GoAdminGroup/go-admin/adapter"
"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/engine"
Expand All @@ -17,10 +22,6 @@ import (
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/buaazp/fasthttprouter"
"github.com/valyala/fasthttp"
"io"
"net/http"
"net/url"
"strings"
)

// Fasthttp structure value is a Fasthttp GoAdmin adapter.
Expand Down
9 changes: 5 additions & 4 deletions adapter/gf/gf.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ package gf
import (
"bytes"
"errors"
"net/http"
"net/url"
"regexp"
"strings"

"github.com/GoAdminGroup/go-admin/adapter"
"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/engine"
Expand All @@ -16,10 +21,6 @@ import (
"github.com/GoAdminGroup/go-admin/plugins/admin/modules/constant"
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/gogf/gf/net/ghttp"
"net/http"
"net/url"
"regexp"
"strings"
)

// Gf structure value is a Gf GoAdmin adapter.
Expand Down
7 changes: 4 additions & 3 deletions adapter/gin/gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ package gin
import (
"bytes"
"errors"
"net/http"
"net/url"
"strings"

"github.com/GoAdminGroup/go-admin/adapter"
"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/engine"
Expand All @@ -16,9 +20,6 @@ import (
"github.com/GoAdminGroup/go-admin/plugins/admin/modules/constant"
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/gin-gonic/gin"
"net/http"
"net/url"
"strings"
)

// Gin structure value is a Gin GoAdmin adapter.
Expand Down
9 changes: 5 additions & 4 deletions adapter/gorilla/gorilla.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ package gorilla
import (
"bytes"
"errors"
"net/http"
"net/url"
"regexp"
"strings"

"github.com/GoAdminGroup/go-admin/adapter"
"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/engine"
Expand All @@ -16,10 +21,6 @@ import (
"github.com/GoAdminGroup/go-admin/plugins/admin/modules/constant"
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/gorilla/mux"
"net/http"
"net/url"
"regexp"
"strings"
)

// Gorilla structure value is a Gorilla GoAdmin adapter.
Expand Down
7 changes: 4 additions & 3 deletions adapter/iris/iris.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ package iris
import (
"bytes"
"errors"
"net/http"
"net/url"
"strings"

"github.com/GoAdminGroup/go-admin/adapter"
"github.com/GoAdminGroup/go-admin/plugins/admin/models"
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/kataras/iris/v12"
"net/http"
"net/url"
"strings"

"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/engine"
Expand Down
3 changes: 2 additions & 1 deletion context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/GoAdminGroup/go-admin/modules/constant"
"io"
"io/ioutil"
"math"
Expand All @@ -20,6 +19,8 @@ import (
"path"
"strings"
"time"

"github.com/GoAdminGroup/go-admin/modules/constant"
)

const abortIndex int8 = math.MaxInt8 / 2
Expand Down
3 changes: 2 additions & 1 deletion context/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package context

import (
"fmt"
"github.com/magiconair/properties/assert"
"testing"

"github.com/magiconair/properties/assert"
)

func TestSlash(t *testing.T) {
Expand Down
7 changes: 4 additions & 3 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
"encoding/json"
errors2 "errors"
"fmt"
"github.com/GoAdminGroup/go-admin/modules/language"
"github.com/GoAdminGroup/go-admin/template/icon"
"github.com/GoAdminGroup/go-admin/template/types/action"
template2 "html/template"
"net/http"
"runtime/debug"
"strings"

"github.com/GoAdminGroup/go-admin/modules/language"
"github.com/GoAdminGroup/go-admin/template/icon"
"github.com/GoAdminGroup/go-admin/template/types/action"

"github.com/GoAdminGroup/go-admin/adapter"
"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/modules/auth"
Expand Down
3 changes: 2 additions & 1 deletion examples/datamodel/content.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package datamodel

import (
"html/template"

"github.com/GoAdminGroup/go-admin/context"
tmpl "github.com/GoAdminGroup/go-admin/template"
"github.com/GoAdminGroup/go-admin/template/chartjs"
Expand All @@ -12,7 +14,6 @@ import (
"github.com/GoAdminGroup/themes/adminlte/components/productlist"
"github.com/GoAdminGroup/themes/adminlte/components/progress_group"
"github.com/GoAdminGroup/themes/adminlte/components/smallbox"
"html/template"
)

// GetContent return the content of index page.
Expand Down
3 changes: 2 additions & 1 deletion examples/datamodel/posts.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package datamodel

import (
template2 "html/template"

"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/modules/db"
"github.com/GoAdminGroup/go-admin/plugins/admin/modules/table"
"github.com/GoAdminGroup/go-admin/template"
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/GoAdminGroup/go-admin/template/types/form"
editType "github.com/GoAdminGroup/go-admin/template/types/table"
template2 "html/template"
)

// GetPostsTable return the model of table posts.
Expand Down
3 changes: 2 additions & 1 deletion examples/datamodel/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package datamodel

import (
"fmt"

"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/modules/db"
form2 "github.com/GoAdminGroup/go-admin/plugins/admin/modules/form"
Expand All @@ -11,7 +12,7 @@ import (
"github.com/GoAdminGroup/go-admin/template/types"
"github.com/GoAdminGroup/go-admin/template/types/action"
"github.com/GoAdminGroup/go-admin/template/types/form"
"github.com/GoAdminGroup/go-admin/template/types/form/select"
selection "github.com/GoAdminGroup/go-admin/template/types/form/select"
editType "github.com/GoAdminGroup/go-admin/template/types/table"
)

Expand Down
3 changes: 2 additions & 1 deletion modules/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
package auth

import (
"sync"

"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/modules/db"
"github.com/GoAdminGroup/go-admin/modules/service"
"github.com/GoAdminGroup/go-admin/plugins/admin/models"
"github.com/GoAdminGroup/go-admin/plugins/admin/modules"
"golang.org/x/crypto/bcrypt"
"sync"
)

// Auth get the user model from Context.
Expand Down
3 changes: 2 additions & 1 deletion modules/auth/auth_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package auth

import (
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestEncodePassword(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions modules/auth/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
package auth

import (
"net/http"
"net/url"

"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/modules/config"
"github.com/GoAdminGroup/go-admin/modules/constant"
Expand All @@ -16,8 +19,6 @@ import (
"github.com/GoAdminGroup/go-admin/plugins/admin/models"
template2 "github.com/GoAdminGroup/go-admin/template"
"github.com/GoAdminGroup/go-admin/template/types"
"net/http"
"net/url"
)

// Invoker contains the callback functions which are used
Expand Down
5 changes: 3 additions & 2 deletions modules/auth/middleware_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package auth

import (
"net/url"
"testing"

"github.com/GoAdminGroup/go-admin/modules/config"
"github.com/GoAdminGroup/go-admin/plugins/admin/models"
"github.com/stretchr/testify/assert"
"net/url"
"testing"
)

func TestCheckPermissions(t *testing.T) {
Expand Down
7 changes: 4 additions & 3 deletions modules/auth/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ package auth

import (
"encoding/json"
"net/http"
"strconv"
"time"

"github.com/GoAdminGroup/go-admin/context"
"github.com/GoAdminGroup/go-admin/modules/config"
"github.com/GoAdminGroup/go-admin/modules/db"
"github.com/GoAdminGroup/go-admin/modules/db/dialect"
"github.com/GoAdminGroup/go-admin/modules/logger"
"github.com/GoAdminGroup/go-admin/plugins/admin/modules"
"net/http"
"strconv"
"time"
)

const DefaultCookieKey = "go_admin_session"
Expand Down
Loading

0 comments on commit 45926f1

Please sign in to comment.