refactor: manually modernize Go (#349)

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2026-05-04 13:20:48 +10:00
committed by GitHub
parent 4503b17046
commit d23f1bdc00
5 changed files with 7 additions and 10 deletions
+2 -2
View File
@@ -242,8 +242,8 @@ func (c *Controller) writeCaddyfileIfChanged(caddyfile string) error {
// caddyfileBody returns the Caddyfile content without its first line, which carries a generation timestamp that
// rotates on every regeneration.
func caddyfileBody(caddyfile string) string {
if i := strings.IndexByte(caddyfile, '\n'); i >= 0 {
return caddyfile[i+1:]
if _, after, ok := strings.Cut(caddyfile, "\n"); ok {
return after
}
return caddyfile
}