CI(linter): enable new linters

This commit is contained in:
xjasonlyu
2023-05-11 10:57:42 +08:00
parent 3b54548914
commit dc6eb815da
2 changed files with 11 additions and 4 deletions

View File

@@ -1,13 +1,20 @@
linters:
disable-all: true
enable:
- gofumpt
- staticcheck
- govet
- gci
- gofumpt
- gosimple
- govet
- ineffassign
- misspell
- staticcheck
- unconvert
- unused
- usestdlibvars
linters-settings:
gci:
custom-order: true
sections:
- standard
- default

View File

@@ -65,7 +65,7 @@ func (ho *HTTPObfs) Write(b []byte) (int, error) {
if ho.firstRequest {
randBytes := make([]byte, 16)
rand.Read(randBytes)
req, _ := http.NewRequest("GET", fmt.Sprintf("http://%s/", ho.host), bytes.NewBuffer(b[:]))
req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s/", ho.host), bytes.NewBuffer(b[:]))
req.Header.Set("User-Agent", fmt.Sprintf("curl/7.%d.%d", mRand.Int()%54, mRand.Int()%2))
req.Header.Set("Upgrade", "websocket")
req.Header.Set("Connection", "Upgrade")