mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 14:14:52 +00:00
refactor: manually modernize Go (#349)
Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
1 parent
4503b17046
commit
d23f1bdc00
5 files changed
+7
-10
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user