mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
fix lint errors
This commit is contained in:
parent
5b4eef5c7b
commit
67f5292f38
@ -16,6 +16,7 @@ type LoggerServer struct {
|
|||||||
V *core.Instance
|
V *core.Instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RestartLogger implements LoggerService.
|
||||||
func (s *LoggerServer) RestartLogger(ctx context.Context, request *RestartLoggerRequest) (*RestartLoggerResponse, error) {
|
func (s *LoggerServer) RestartLogger(ctx context.Context, request *RestartLoggerRequest) (*RestartLoggerResponse, error) {
|
||||||
logger := s.V.GetFeature((*log.Instance)(nil))
|
logger := s.V.GetFeature((*log.Instance)(nil))
|
||||||
if logger == nil {
|
if logger == nil {
|
||||||
|
@ -138,10 +138,10 @@ func (g *Instance) Close() error {
|
|||||||
|
|
||||||
g.active = false
|
g.active = false
|
||||||
|
|
||||||
common.Close(g.accessLogger)
|
common.Ignore(common.Close(g.accessLogger), "Recycling it anyway")
|
||||||
g.accessLogger = nil
|
g.accessLogger = nil
|
||||||
|
|
||||||
common.Close(g.errorLogger)
|
common.Ignore(common.Close(g.errorLogger), "Recycling this too")
|
||||||
g.errorLogger = nil
|
g.errorLogger = nil
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
package proxyman
|
|
||||||
|
|
||||||
import "v2ray.com/core/common/errors"
|
|
||||||
|
|
||||||
func newError(values ...interface{}) *errors.Error {
|
|
||||||
return errors.New(values...).Path("App", "Proxyman")
|
|
||||||
}
|
|
@ -1,8 +1,6 @@
|
|||||||
// Package proxyman defines applications for managing inbound and outbound proxies.
|
// Package proxyman defines applications for managing inbound and outbound proxies.
|
||||||
package proxyman
|
package proxyman
|
||||||
|
|
||||||
//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg proxyman -path App,Proxyman
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
)
|
)
|
||||||
|
@ -74,10 +74,12 @@ func (m *Manager) GetCounter(name string) core.StatCounter {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start implements common.Runnable.
|
||||||
func (m *Manager) Start() error {
|
func (m *Manager) Start() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Close implement common.Closable.
|
||||||
func (m *Manager) Close() error {
|
func (m *Manager) Close() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ func (v *Error) WithContext(ctx context.Context) *Error {
|
|||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Context returns the context that associated with the Error.
|
||||||
func (v *Error) Context() context.Context {
|
func (v *Error) Context() context.Context {
|
||||||
if v.ctx != nil {
|
if v.ctx != nil {
|
||||||
return v.ctx
|
return v.ctx
|
||||||
|
@ -5,8 +5,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg confloader -path Main,ConfLoader
|
|
||||||
|
|
||||||
type configFileLoader func(string) (io.ReadCloser, error)
|
type configFileLoader func(string) (io.ReadCloser, error)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
package confloader
|
|
||||||
|
|
||||||
import "v2ray.com/core/common/errors"
|
|
||||||
|
|
||||||
func newError(values ...interface{}) *errors.Error {
|
|
||||||
return errors.New(values...).Path("Main", "ConfLoader")
|
|
||||||
}
|
|
@ -29,6 +29,7 @@ type Handler struct {
|
|||||||
v *core.Instance
|
v *core.Instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// New creates a new VMess outbound handler.
|
||||||
func New(ctx context.Context, config *Config) (*Handler, error) {
|
func New(ctx context.Context, config *Config) (*Handler, error) {
|
||||||
serverList := protocol.NewServerList()
|
serverList := protocol.NewServerList()
|
||||||
for _, rec := range config.Receiver {
|
for _, rec := range config.Receiver {
|
||||||
|
@ -56,7 +56,7 @@ func NewTimedUserValidator(hasher protocol.IDHash) *TimedUserValidator {
|
|||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
tuv.task.Start()
|
common.Must(tuv.task.Start())
|
||||||
return tuv
|
return tuv
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@ import (
|
|||||||
// DTLS writes header as DTLS. See https://tools.ietf.org/html/rfc6347
|
// DTLS writes header as DTLS. See https://tools.ietf.org/html/rfc6347
|
||||||
type DTLS struct {
|
type DTLS struct {
|
||||||
epoch uint16
|
epoch uint16
|
||||||
sequence uint32
|
|
||||||
length uint16
|
length uint16
|
||||||
|
sequence uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Size implements PacketHeader.
|
// Size implements PacketHeader.
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"v2ray.com/core/common/signal"
|
"v2ray.com/core/common/signal"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Option for creating new Pipes.
|
||||||
type Option func(*pipe)
|
type Option func(*pipe)
|
||||||
|
|
||||||
func WithoutSizeLimit() Option {
|
func WithoutSizeLimit() Option {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user