Skip to content

Commit 3c42131

Browse files
authored
go fix ./... (#127)
1 parent 385594a commit 3c42131

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

sumdb/proxy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ func newReverseProxy(opts ProxyOpts) *httputil.ReverseProxy {
8484
}
8585
r.SetURL(distributor)
8686
r.Out.URL.Path = fmt.Sprintf(distributorCheckpointPathFmt, opts.WitnessSigs)
87-
} else if strings.HasPrefix(inPath, tlogEntriesPrefix) {
88-
o := strings.TrimPrefix(inPath, tlogEntriesPrefix)
87+
} else if after, ok := strings.CutPrefix(inPath, tlogEntriesPrefix); ok {
88+
o := after
8989
r.Out.URL.Path = fmt.Sprintf("%s%s", sumDBTileDataPrefix, o)
90-
} else if strings.HasPrefix(inPath, tlogTilePrefix) {
91-
o := strings.TrimPrefix(inPath, tlogTilePrefix)
90+
} else if after, ok := strings.CutPrefix(inPath, tlogTilePrefix); ok {
91+
o := after
9292
r.Out.URL.Path = fmt.Sprintf("%s%s", sumDBTilePrefix, o)
9393
}
9494
},

0 commit comments

Comments
 (0)