ing
This commit is contained in:
parent
5a3f20551f
commit
ab4f7f28be
39
golint.json
Normal file
39
golint.json
Normal file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"DisableAll": true,
|
||||
"Enable": [
|
||||
"aligncheck",
|
||||
"deadcode",
|
||||
"dupl",
|
||||
"errcheck",
|
||||
"gas",
|
||||
"goconst",
|
||||
"gocyclo",
|
||||
"gofmt",
|
||||
"goimports",
|
||||
"golint",
|
||||
"gotype",
|
||||
"ineffassign",
|
||||
"interfacer",
|
||||
"lll",
|
||||
"megacheck",
|
||||
"misspell",
|
||||
"structcheck",
|
||||
"test",
|
||||
"testify",
|
||||
"unconvert",
|
||||
"varcheck",
|
||||
"vet",
|
||||
"vetshadow"
|
||||
],
|
||||
"Aggregate": true,
|
||||
"Concurrency": 16,
|
||||
"Cyclo": 60,
|
||||
"Deadline": "60s",
|
||||
"DuplThreshold": 50,
|
||||
"EnableGC": true,
|
||||
"LineLength": 120,
|
||||
"MinConfidence": 0.8,
|
||||
"MinOccurrences": 3,
|
||||
"MinConstLength": 3,
|
||||
"Sort": ["severity"]
|
||||
}
|
|
@ -48,9 +48,10 @@ func (h *messageHandler) onRequest(soc gws.Socket, req *ServerRequest) []byte {
|
|||
result, err := h.o.OnRequest(soc, req.Method, req.Params)
|
||||
|
||||
res := &ServerResponse{
|
||||
Id: req.Id,
|
||||
Result: result,
|
||||
Error: err,
|
||||
Protocol: req.Protocol,
|
||||
Result: result,
|
||||
Error: err,
|
||||
Id: req.Id,
|
||||
}
|
||||
|
||||
j, err := json.Marshal(res)
|
||||
|
|
|
@ -5,9 +5,10 @@ import (
|
|||
)
|
||||
|
||||
type ServerRequest struct {
|
||||
Method string `json:"method"`
|
||||
Params []string `json:"params,omitempty"`
|
||||
Id *json.RawMessage `json:"id,omitempty"`
|
||||
Protocol string `json:"protocol"`
|
||||
Method string `json:"method"`
|
||||
Params []string `json:"params,omitempty"`
|
||||
Id *json.RawMessage `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (r *ServerRequest) reset() {
|
||||
|
|
|
@ -5,7 +5,8 @@ import (
|
|||
)
|
||||
|
||||
type ServerResponse struct {
|
||||
Id *json.RawMessage `json:"id,omitempty"`
|
||||
Result interface{} `json:"result,omitempty"`
|
||||
Error interface{} `json:"error,omitempty"`
|
||||
Protocol string `json:"protocol"`
|
||||
Result interface{} `json:"result,omitempty"`
|
||||
Error interface{} `json:"error,omitempty"`
|
||||
Id *json.RawMessage `json:"id,omitempty"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user