1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

Chore: fix lint according to golangci-lint errors (#781)

* Chore: fix lint according to golangci-lint errors
* Chore: regenerate pb.go files
This commit is contained in:
Loyalsoldier 2021-03-14 07:44:47 +08:00 committed by GitHub
parent 88e1e25aa9
commit e46204f828
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 23 deletions

View File

@ -305,8 +305,7 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
common.Interrupt(link.Reader)
return
}
} else {
if d.router != nil {
} else if d.router != nil {
if route, err := d.router.PickRoute(routing_session.AsRoutingContext(ctx)); err == nil {
tag := route.GetOutboundTag()
if h := d.ohm.GetHandler(tag); h != nil {
@ -319,7 +318,6 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
newError("default route for ", destination).WriteToLog(session.ExportIDToError(ctx))
}
}
}
if handler == nil {
handler = d.ohm.GetDefaultHandler()

View File

@ -6,7 +6,7 @@ import (
"context"
"time"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
"github.com/v2fly/v2ray-core/v4/common/mux"
"github.com/v2fly/v2ray-core/v4/common/net"

View File

@ -86,7 +86,6 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
}
conds.Add(matcher)
}
}
if len(rr.UserEmail) > 0 {

View File

@ -135,11 +135,11 @@ type DialingWorkerFactory struct {
ctx context.Context
}
func NewDialingWorkerFactory(ctx context.Context, Proxy proxy.Outbound, Dialer internet.Dialer, Strategy ClientStrategy) *DialingWorkerFactory {
func NewDialingWorkerFactory(ctx context.Context, proxy proxy.Outbound, dialer internet.Dialer, strategy ClientStrategy) *DialingWorkerFactory {
return &DialingWorkerFactory{
Proxy: Proxy,
Dialer: Dialer,
Strategy: Strategy,
Proxy: proxy,
Dialer: dialer,
Strategy: strategy,
ctx: ctx,
}
}

View File

@ -6,7 +6,7 @@ import (
"io"
"strings"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"

View File

@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/golang/protobuf/proto"
"github.com/google/go-cmp/cmp"
"google.golang.org/protobuf/proto"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/dispatcher"

View File

@ -23,6 +23,7 @@ import (
_ "github.com/v2fly/v2ray-core/v4/app/router"
_ "github.com/v2fly/v2ray-core/v4/app/stats"
// Fix dependency cycle caused by core import in internet package
_ "github.com/v2fly/v2ray-core/v4/transport/internet/tagged/taggedimpl"
// Inbound and outbound proxies.

View File

@ -198,9 +198,8 @@ func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
}
if s.isAEADForced {
return nil, drainConnection(newError("invalid user: VMessAEAD is enforced and a non VMessAEAD connection is received. You can still disable this security feature with environment variable v2ray.vmess.aead.forced = false . You will not be able to enable legacy header workaround in the future."))
} else {
newError("Critical Warning: potentially invalid user: a non VMessAEAD connection is received. From 2022 Jan 1st, this kind of connection will be rejected by default. You should update or replace your client software now. ").AtWarning().WriteToLog()
}
newError("Critical Warning: potentially invalid user: a non VMessAEAD connection is received. From 2022 Jan 1st, this kind of connection will be rejected by default. You should update or replace your client software now. ").AtWarning().WriteToLog()
user = userLegacy
iv := hashTimestamp(md5.New(), timestamp)
vmessAccount = userLegacy.Account.(*vmess.MemoryAccount)

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.13.0
// protoc v3.15.5
// source: transport/internet/grpc/config.proto
package grpc

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.13.0
// protoc v3.15.5
// source: transport/internet/grpc/encoding/stream.proto
package encoding