mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-02 17:58:46 +00:00
GitHub Action CI: Add Go source file format check (#6090)
https://github.com/XTLS/Xray-core/pull/6057#issuecomment-4364819830 And https://github.com/XTLS/Xray-core/pull/6149#issuecomment-4546876261
This commit is contained in:
committed by
GitHub
parent
ca4b156b57
commit
d43a808ea5
@@ -53,7 +53,7 @@ func TestRequestSerialization(t *testing.T) {
|
||||
}
|
||||
|
||||
addonsComparer := func(x, y *Addons) bool {
|
||||
return (x.Flow == y.Flow) && (cmp.Equal(x.Seed, y.Seed))
|
||||
return (x.Flow == y.Flow) && cmp.Equal(x.Seed, y.Seed)
|
||||
}
|
||||
if r := cmp.Diff(actualAddons, expectedAddons, cmp.Comparer(addonsComparer)); r != "" {
|
||||
t.Error(r)
|
||||
@@ -125,7 +125,7 @@ func TestMuxRequest(t *testing.T) {
|
||||
}
|
||||
|
||||
addonsComparer := func(x, y *Addons) bool {
|
||||
return (x.Flow == y.Flow) && (cmp.Equal(x.Seed, y.Seed))
|
||||
return (x.Flow == y.Flow) && cmp.Equal(x.Seed, y.Seed)
|
||||
}
|
||||
if r := cmp.Diff(actualAddons, expectedAddons, cmp.Comparer(addonsComparer)); r != "" {
|
||||
t.Error(r)
|
||||
|
||||
@@ -79,7 +79,7 @@ func (i *ClientInstance) Handshake(conn net.Conn) (*CommonConn, error) {
|
||||
var nfsKey []byte
|
||||
var lastCTR cipher.Stream
|
||||
for j, k := range i.NfsPKeys {
|
||||
var index = 32
|
||||
index := 32
|
||||
if k, ok := k.(*ecdh.PublicKey); ok {
|
||||
privateKey, _ := ecdh.X25519().GenerateKey(rand.Reader)
|
||||
copy(relays, privateKey.PublicKey().Bytes())
|
||||
|
||||
@@ -135,7 +135,7 @@ func (i *ServerInstance) Handshake(conn net.Conn, fallback *[]byte) (*CommonConn
|
||||
if lastCTR != nil {
|
||||
lastCTR.XORKeyStream(relays, relays[:32]) // recover this relay
|
||||
}
|
||||
var index = 32
|
||||
index := 32
|
||||
if _, ok := k.(*mlkem.DecapsulationKey768); ok {
|
||||
index = 1088
|
||||
}
|
||||
|
||||
@@ -630,9 +630,11 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
||||
return r.NewMux(ctx, dispatcher.WrapLink(ctx, h.policyManager, h.stats, &transport.Link{Reader: clientReader, Writer: clientWriter}), h.observer)
|
||||
}
|
||||
|
||||
if err := dispatch.DispatchLink(ctx, request.Destination(), &transport.Link{
|
||||
Reader: clientReader,
|
||||
Writer: clientWriter},
|
||||
if err := dispatch.DispatchLink(
|
||||
ctx, request.Destination(), &transport.Link{
|
||||
Reader: clientReader,
|
||||
Writer: clientWriter,
|
||||
},
|
||||
); err != nil {
|
||||
return errors.New("failed to dispatch request").Base(err)
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ func (v *MemoryValidator) GetByEmail(email string) *protocol.MemoryUser {
|
||||
|
||||
// Get all users
|
||||
func (v *MemoryValidator) GetAll() []*protocol.MemoryUser {
|
||||
var u = make([]*protocol.MemoryUser, 0, 100)
|
||||
u := make([]*protocol.MemoryUser, 0, 100)
|
||||
v.email.Range(func(key, value interface{}) bool {
|
||||
u = append(u, value.(*protocol.MemoryUser))
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user