mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
Chore: Run gofmt (#3990)
This commit is contained in:
parent
bc4bf3d38f
commit
83bab5dd90
50 changed files with 272 additions and 273 deletions
|
@ -218,7 +218,7 @@ func (b *Buffer) Cap() int32 {
|
|||
// NewWithSize creates a Buffer with 0 length and capacity with at least the given size.
|
||||
func NewWithSize(size int32) *Buffer {
|
||||
return &Buffer{
|
||||
v: bytespool.Alloc(size),
|
||||
v: bytespool.Alloc(size),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ type SessionKey int
|
|||
// ID of a session.
|
||||
type ID uint32
|
||||
|
||||
const(
|
||||
const (
|
||||
idSessionKey SessionKey = 0
|
||||
)
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ func ToProtoUser(mu *MemoryUser) *User {
|
|||
}
|
||||
return &User{
|
||||
Account: serial.ToTypedMessage(mu.Account.ToProto()),
|
||||
Email: mu.Email,
|
||||
Level: mu.Level,
|
||||
Email: mu.Email,
|
||||
Level: mu.Level,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ func MarshalToJson(v interface{}, insertTypeInfo bool) (string, bool) {
|
|||
}
|
||||
|
||||
func JSONMarshalWithoutEscape(t interface{}) ([]byte, error) {
|
||||
buffer := &bytes.Buffer{}
|
||||
encoder := json.NewEncoder(buffer)
|
||||
encoder.SetIndent("", " ")
|
||||
encoder.SetEscapeHTML(false)
|
||||
err := encoder.Encode(t)
|
||||
return buffer.Bytes(), err
|
||||
buffer := &bytes.Buffer{}
|
||||
encoder := json.NewEncoder(buffer)
|
||||
encoder.SetIndent("", " ")
|
||||
encoder.SetEscapeHTML(false)
|
||||
err := encoder.Encode(t)
|
||||
return buffer.Bytes(), err
|
||||
}
|
||||
|
||||
func marshalTypedMessage(v *cserial.TypedMessage, ignoreNullValue bool, insertTypeInfo bool) interface{} {
|
||||
|
|
|
@ -148,4 +148,4 @@ func (c *Content) AttributeLen() int {
|
|||
c.mu.Unlock()
|
||||
}()
|
||||
return len(c.Attributes)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,9 +48,9 @@ func (d *XrayOutboundDialer) DialContext(ctx context.Context, network string, de
|
|||
outbounds = []*session.Outbound{{}}
|
||||
ctx = session.ContextWithOutbounds(ctx, outbounds)
|
||||
}
|
||||
ob := outbounds[len(outbounds) - 1]
|
||||
ob := outbounds[len(outbounds)-1]
|
||||
ob.Target = ToDestination(destination, ToNetwork(network))
|
||||
|
||||
|
||||
opts := []pipe.Option{pipe.WithSizeLimit(64 * 1024)}
|
||||
uplinkReader, uplinkWriter := pipe.New(opts...)
|
||||
downlinkReader, downlinkWriter := pipe.New(opts...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue