r/strings\.Replace/strings\.ReplaceAll/

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
This commit is contained in:
Mohammed Al Sahaf 2025-08-04 00:53:51 +03:00
parent ed9afb05d8
commit 3bcfeee97a
No known key found for this signature in database

View File

@ -129,7 +129,7 @@ func (nw *NetWriter) WriterKey() string {
func (nw *NetWriter) OpenWriter() (io.WriteCloser, error) {
// Set up WAL directory
baseDir := caddy.AppDataDir()
nw.walDir = filepath.Join(baseDir, "wal", "netwriter", strings.Replace(nw.addr.String(), ":", "-", -1))
nw.walDir = filepath.Join(baseDir, "wal", "netwriter", strings.ReplaceAll(nw.addr.String(), ":", "-"))
if err := os.MkdirAll(nw.walDir, 0o755); err != nil {
return nil, fmt.Errorf("failed to create WAL directory: %v", err)
}