From e7ba8fa97f7f8d837f3e5c47ad749e6e3d63bbf4 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 6 Jul 2026 20:06:11 -0400 Subject: [PATCH] Fix inefficient string concats --- go.mod | 8 ++++---- go.sum | 12 ++++++------ system.go | 4 +++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index ad24e3b..6cf07f7 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module cachy-post -go 1.25.5 +go 1.26.4 require ( github.com/moby/sys/mountinfo v0.7.2 - github.com/rwinkhart/go-boilerplate v0.1.1 + github.com/rwinkhart/go-boilerplate v0.3.1 ) require ( - golang.org/x/sys v0.39.0 // indirect - golang.org/x/term v0.38.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/term v0.44.0 // indirect ) diff --git a/go.sum b/go.sum index c59f830..fbef063 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4= -github.com/rwinkhart/go-boilerplate v0.1.1 h1:C+yyscGWeqvNpR91iw0i91zqX0LcxnCr1VOyT7iM4JY= -github.com/rwinkhart/go-boilerplate v0.1.1/go.mod h1:/NVRKGslU20E5xU5YOgXzWxA6aa94BMtv5MtHRTb5Ek= -golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= -golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q= -golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= +github.com/rwinkhart/go-boilerplate v0.3.1 h1:vkVRuptO2s1yPzzwpvtiiB0c/hPB6yr0p1mzZ2Myb9E= +github.com/rwinkhart/go-boilerplate v0.3.1/go.mod h1:ES13A2r9fnCVfyezwMBgY/RgA4pOIudOUXz3Jk/ikes= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= +golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= diff --git a/system.go b/system.go index 28f42eb..5f24e8f 100644 --- a/system.go +++ b/system.go @@ -44,7 +44,9 @@ func system() { var sysctlConf strings.Builder sysctlConf.WriteString("net.ipv6.conf.all.use_tempaddr = 2\nnet.ipv6.conf.default.use_tempaddr = 2") for _, nic := range nics { - sysctlConf.WriteString("\nnet.ipv6.conf." + nic.Name() + ".use_tempaddr = 2") + sysctlConf.WriteString("\nnet.ipv6.conf.") + sysctlConf.WriteString(nic.Name()) + sysctlConf.WriteString(".use_tempaddr = 2") } writeFile(mountPoint+"/etc/sysctl.d/40-ipv6-priv-ext.conf", sysctlConf.String()+"\n", "root", 0644)