Skip to content
Open

fix #18

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/go-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main # 或者你的默认分支
- master

jobs:
build:
Expand All @@ -17,11 +18,13 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.16' # 指定Go的版本
go-version: '1.21' # 指定Go的版本

- name: Lint with golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v6
with:
version: latest
github-token: ${{ secrets.GITHUB_TOKEN }}
# only-new-issues: true
args: --issues-exit-code=0 --out-format=github-actions

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ _cgo_export.*
.vscode/*
.DS_Store
Thumbs.db
.history
9 changes: 7 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"net"
"net/http"

"github.com/ckeyer/diego/api/view"
"github.com/ckeyer/diego/pkgs/apis/ginmd"
"github.com/ckeyer/diego/version"
"github.com/gin-gonic/gin"
Expand All @@ -18,6 +17,8 @@ const (
PrefixRelease = "release"
// PrefixWebhook webhook
PrefixWebhook = "webhook"

Prefix_Api_Test = "test"
)

// Serve start http server.
Expand All @@ -29,7 +30,7 @@ func Serve(addr string) error {

gs := gin.New()
gs.Use(ginmd.MDCors())
gs.NoRoute(view.UI())
// gs.NoRoute(view.UI())
gs.Use(ginmd.MDRecovery(), ginmd.MDLogger())

apiRoute(gs.Group(PrefixAPI))
Expand Down Expand Up @@ -61,3 +62,7 @@ func getVersion(ctx *gin.Context) {
func decodeBody(ctx *gin.Context, v interface{}) error {
return json.NewDecoder(ctx.Request.Body).Decode(v)
}

func EncodeJSON(ctx *gin.Context, v interface{}) error {
return json.NewEncoder(ctx.Writer).Encode(v)
}
1 change: 0 additions & 1 deletion api/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"github.com/gin-gonic/gin"
)

// usersRouters ...
func usersRouters(gr *gin.RouterGroup) {
gr.GET("", users.ListUsers)
gr.POST("", users.CreateUser)
Expand Down
51 changes: 0 additions & 51 deletions api/view/view.go

This file was deleted.