Skip to content

Commit 07a9269

Browse files
author
user123456
committed
优化代码格式
1 parent 1881b5b commit 07a9269

File tree

12 files changed

+94
-111
lines changed

12 files changed

+94
-111
lines changed

src/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func DefaultConfig() *AppConfig {
7878
Host: "0.0.0.0",
7979
Port: 5000,
8080
FileSize: 2 * 1024 * 1024 * 1024, // 2GB
81-
EnableH2C: false, // 默认关闭H2C
81+
EnableH2C: false, // 默认关闭H2C
8282
},
8383
RateLimit: struct {
8484
RequestLimit int `toml:"requestLimit"`
@@ -268,4 +268,4 @@ func CreateDefaultConfigFile() error {
268268
}
269269

270270
return os.WriteFile("config.toml", data, 0644)
271-
}
271+
}

src/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ require (
4444
github.com/vbatts/tar-split v0.12.1 // indirect
4545
golang.org/x/arch v0.8.0 // indirect
4646
golang.org/x/crypto v0.32.0 // indirect
47-
golang.org/x/net v0.33.0 // indirect
4847
golang.org/x/sync v0.14.0 // indirect
4948
golang.org/x/sys v0.33.0 // indirect
5049
golang.org/x/text v0.21.0 // indirect

src/handlers/docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,4 +605,4 @@ func createUpstreamOptions(mapping config.RegistryMapping) []remote.Option {
605605
}
606606

607607
return options
608-
}
608+
}

src/handlers/github.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func GitHubProxyHandler(c *gin.Context) {
3636
for strings.HasPrefix(rawPath, "/") {
3737
rawPath = strings.TrimPrefix(rawPath, "/")
3838
}
39-
39+
4040
// 自动补全协议头
4141
if !strings.HasPrefix(rawPath, "https://") {
4242
if strings.HasPrefix(rawPath, "http:/") || strings.HasPrefix(rawPath, "https:/") {
@@ -47,7 +47,7 @@ func GitHubProxyHandler(c *gin.Context) {
4747
}
4848
rawPath = "https://" + rawPath
4949
}
50-
50+
5151
matches := CheckGitHubURL(rawPath)
5252
if matches != nil {
5353
if allowed, reason := utils.GlobalAccessController.CheckGitHubAccess(matches); !allowed {
@@ -96,7 +96,7 @@ func proxyGitHubWithRedirect(c *gin.Context, u string, redirectCount int) {
9696
c.String(http.StatusLoopDetected, "重定向次数过多,可能存在循环重定向")
9797
return
9898
}
99-
99+
100100
req, err := http.NewRequest(c.Request.Method, u, c.Request.Body)
101101
if err != nil {
102102
c.String(http.StatusInternalServerError, fmt.Sprintf("server error %v", err))
@@ -210,4 +210,4 @@ func proxyGitHubWithRedirect(c *gin.Context, u string, redirectCount int) {
210210
// 直接流式转发
211211
io.Copy(c.Writer, resp.Body)
212212
}
213-
}
213+
}

src/handlers/imagetar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,4 +855,4 @@ func (is *ImageStreamer) StreamMultipleImages(ctx context.Context, imageRefs []s
855855

856856
log.Printf("批量下载完成,共处理 %d 个镜像", len(imageRefs))
857857
return nil
858-
}
858+
}

0 commit comments

Comments
 (0)