Chore: Run gofmt (#3990)

This commit is contained in:
zonescape 2024-11-09 14:16:11 +03:00 committed by GitHub
parent bc4bf3d38f
commit 83bab5dd90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 272 additions and 273 deletions

View file

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

View file

@ -7,7 +7,7 @@ type SessionKey int
// ID of a session.
type ID uint32
const(
const (
idSessionKey SessionKey = 0
)

View file

@ -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,
}
}

View file

@ -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{} {

View file

@ -148,4 +148,4 @@ func (c *Content) AttributeLen() int {
c.mu.Unlock()
}()
return len(c.Attributes)
}
}

View file

@ -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...)