Skip to content

refactor: remove the hardcoded httpmethod and update ci tools #647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ _testmain.go
bee
*.exe~
.goxc.local.json

# go mod
go.sum
21 changes: 6 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
language: go
go:
- 1.10.3
- "1.12.x"
install:
- export GO111MODULE=on
- export PATH=$PATH:$HOME/gopath/bin
- go get -u github.com/opennota/check/cmd/structcheck
- go get -u honnef.co/go/tools/cmd/gosimple
- go get -u honnef.co/go/tools/cmd/staticcheck
- go get -u honnef.co/go/tools/cmd/unused
- go get -u github.com/mdempsky/unconvert
- go get -u github.com/gordonklaus/ineffassign
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.1

script:
- find . ! \( -path './vendor' -prune \) -type f -name '*.go' -print0 | xargs -0 gofmt -l -s
- go vet $(go list ./... | grep -v /vendor/)
- structcheck $(go list ./... | grep -v /vendor/)
- gosimple -ignore "$(cat gosimple.ignore)" $(go list ./... | grep -v /vendor/)
- staticcheck -ignore "$(cat staticcheck.ignore)" $(go list ./... | grep -v /vendor/)
- unused $(go list ./... | grep -v /vendor/)
- unconvert $(go list ./... | grep -v /vendor/)
- ineffassign .
- go mod download
- golangci-lint run -D errcheck
2 changes: 1 addition & 1 deletion cmd/commands/api/apiapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ func init() {

// TestGet is a sample to run an endpoint test
func TestGet(t *testing.T) {
r, _ := http.NewRequest("GET", "/v1/object", nil)
r, _ := http.NewRequest(http.MethodGet, "/v1/object", nil)
w := httptest.NewRecorder()
beego.BeeApp.Handlers.ServeHTTP(w, r)

Expand Down
14 changes: 7 additions & 7 deletions cmd/commands/dlv/dlv_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import (
"github.com/beego/bee/cmd/commands/version"
beeLogger "github.com/beego/bee/logger"
"github.com/beego/bee/utils"
"github.com/derekparker/delve/service"
"github.com/derekparker/delve/service/rpc2"
"github.com/derekparker/delve/service/rpccommon"
"github.com/derekparker/delve/terminal"
"github.com/fsnotify/fsnotify"
"github.com/go-delve/delve/pkg/terminal"
"github.com/go-delve/delve/service"
"github.com/go-delve/delve/service/rpc2"
"github.com/go-delve/delve/service/rpccommon"
)

var cmdDlv = &commands.Command{
Expand All @@ -43,7 +43,7 @@ var cmdDlv = &commands.Command{

To debug your application using Delve, use: {{"$ bee dlv" | bold}}

For more information on Delve: https://github.com/derekparker/delve
For more information on Delve: https://github.com/go-delve/delve
`,
PreRun: func(cmd *commands.Command, args []string) { version.ShowShortVersionBanner() },
Run: runDlv,
Expand Down Expand Up @@ -152,7 +152,7 @@ func startDelveDebugger(addr string, ch chan int) int {
APIVersion: 2,
WorkingDir: ".",
ProcessArgs: []string{abs},
}, false)
})
if err := server.Run(); err != nil {
beeLogger.Log.Fatalf("Could not start debugger server: %v", err)
}
Expand Down Expand Up @@ -182,7 +182,7 @@ func startDelveDebugger(addr string, ch chan int) int {
}

// Stop and kill the debugger server once user quits the REPL
if err := server.Stop(true); err != nil {
if err := server.Stop(); err != nil {
beeLogger.Log.Fatalf("Could not stop Delve server: %v", err)
}
return status
Expand Down
2 changes: 1 addition & 1 deletion cmd/commands/new/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func init() {

// TestBeego is a sample to run an endpoint test
func TestBeego(t *testing.T) {
r, _ := http.NewRequest("GET", "/", nil)
r, _ := http.NewRequest(http.MethodGet, "/", nil)
w := httptest.NewRecorder()
beego.BeeApp.Handlers.ServeHTTP(w, r)

Expand Down
19 changes: 19 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module github.com/beego/bee

go 1.12

require (
github.com/astaxie/beego v1.10.0
github.com/fsnotify/fsnotify v1.4.7
github.com/go-delve/delve v1.3.2
github.com/go-sql-driver/mysql v1.2.1-0.20160113114805-6fd058ce0d6b
github.com/gorilla/websocket v1.1.1-0.20170302224613-b258b4fadb57
github.com/lib/pq v0.0.0-20160806144029-80f8150043c8
github.com/peterh/liner v1.1.0 // indirect
github.com/rogpeppe/go-internal v1.5.2 // indirect
golang.org/x/mod v0.2.0 // indirect
golang.org/x/tools v0.0.0-20200119215504-eb0d8dd85bcc // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
gopkg.in/yaml.v2 v2.2.1
honnef.co/go/tools v0.0.1-2019.2.3 // indirect
)
3 changes: 0 additions & 3 deletions gosimple.ignore

This file was deleted.

174 changes: 0 additions & 174 deletions vendor/github.com/astaxie/beego/swagger/swagger.go

This file was deleted.

25 changes: 0 additions & 25 deletions vendor/github.com/astaxie/beego/utils/caller.go

This file was deleted.

Loading