Browse Source

style: format struct literals and whitespace

Clean up trailing braces, commas, and unnecessary blank lines in struct initializations across sub and network packages.
Sanaei 13 giờ trước cách đây
mục cha
commit
cc245a908e
2 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 2 3
      internal/sub/json_service.go
  2. 2 1
      internal/web/network/auto_https_conn.go

+ 2 - 3
internal/sub/json_service.go

@@ -690,7 +690,6 @@ func jsonMux(global, override string) string {
 
 func (s *SubJsonService) genVnext(inbound *model.Inbound, streamSettings json_util.RawMessage, client model.Client, mux string) json_util.RawMessage {
 	outbound := Outbound{
-
 		Protocol: string(inbound.Protocol),
 		Tag:      "proxy"}
 	if mux != "" {
@@ -714,7 +713,8 @@ func (s *SubJsonService) genVnext(inbound *model.Inbound, streamSettings json_ut
 func (s *SubJsonService) genVless(subReq *SubService, inbound *model.Inbound, streamSettings json_util.RawMessage, client model.Client, mux string) json_util.RawMessage {
 	outbound := Outbound{
 		Protocol: string(inbound.Protocol),
-		Tag:      "proxy"}
+		Tag:      "proxy",
+	}
 	if mux != "" {
 		outbound.Mux = json_util.RawMessage(mux)
 	}
@@ -793,7 +793,6 @@ func (s *SubJsonService) genServer(subReq *SubService, inbound *model.Inbound, s
 
 func (s *SubJsonService) genHy(inbound *model.Inbound, newStream map[string]any, client model.Client, mux string) json_util.RawMessage {
 	outbound := Outbound{
-
 		Protocol: string(inbound.Protocol),
 		Tag:      "proxy"}
 

+ 2 - 1
internal/web/network/auto_https_conn.go

@@ -47,7 +47,8 @@ func (c *AutoHttpsConn) readRequest() bool {
 	resp := http.Response{
 		Header: http.Header{},
 
-		StatusCode: http.StatusTemporaryRedirect}
+		StatusCode: http.StatusTemporaryRedirect,
+	}
 	location := fmt.Sprintf("https://%v%v", request.Host, request.RequestURI)
 	resp.Header.Set("Location", location)
 	_ = resp.Write(c.Conn)