1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 17:46:58 -05:00

fix lint errors

This commit is contained in:
Darien Raymond 2018-05-25 23:20:24 +02:00
parent 5b4eef5c7b
commit 67f5292f38
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
12 changed files with 10 additions and 22 deletions

View File

@ -16,6 +16,7 @@ type LoggerServer struct {
V *core.Instance
}
// RestartLogger implements LoggerService.
func (s *LoggerServer) RestartLogger(ctx context.Context, request *RestartLoggerRequest) (*RestartLoggerResponse, error) {
logger := s.V.GetFeature((*log.Instance)(nil))
if logger == nil {

View File

@ -138,10 +138,10 @@ func (g *Instance) Close() error {
g.active = false
common.Close(g.accessLogger)
common.Ignore(common.Close(g.accessLogger), "Recycling it anyway")
g.accessLogger = nil
common.Close(g.errorLogger)
common.Ignore(common.Close(g.errorLogger), "Recycling this too")
g.errorLogger = nil
return nil

View File

@ -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")
}

View File

@ -1,8 +1,6 @@
// Package proxyman defines applications for managing inbound and outbound proxies.
package proxyman
//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg proxyman -path App,Proxyman
import (
"context"
)

View File

@ -74,10 +74,12 @@ func (m *Manager) GetCounter(name string) core.StatCounter {
return nil
}
// Start implements common.Runnable.
func (m *Manager) Start() error {
return nil
}
// Close implement common.Closable.
func (m *Manager) Close() error {
return nil
}

View File

@ -63,6 +63,7 @@ func (v *Error) WithContext(ctx context.Context) *Error {
return v
}
// Context returns the context that associated with the Error.
func (v *Error) Context() context.Context {
if v.ctx != nil {
return v.ctx

View File

@ -5,8 +5,6 @@ import (
"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)
var (

View File

@ -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")
}

View File

@ -29,6 +29,7 @@ type Handler struct {
v *core.Instance
}
// New creates a new VMess outbound handler.
func New(ctx context.Context, config *Config) (*Handler, error) {
serverList := protocol.NewServerList()
for _, rec := range config.Receiver {

View File

@ -56,7 +56,7 @@ func NewTimedUserValidator(hasher protocol.IDHash) *TimedUserValidator {
return nil
},
}
tuv.task.Start()
common.Must(tuv.task.Start())
return tuv
}

View File

@ -10,8 +10,8 @@ import (
// DTLS writes header as DTLS. See https://tools.ietf.org/html/rfc6347
type DTLS struct {
epoch uint16
sequence uint32
length uint16
sequence uint32
}
// Size implements PacketHeader.

View File

@ -7,6 +7,7 @@ import (
"v2ray.com/core/common/signal"
)
// Option for creating new Pipes.
type Option func(*pipe)
func WithoutSizeLimit() Option {