Replace utils.Once with stdlib sync.OnceValue

This commit is contained in:
Kovid Goyal
2023-08-09 12:08:42 +05:30
parent 49ea26968c
commit 4f72bb9894
22 changed files with 53 additions and 96 deletions

View File

@@ -7,6 +7,7 @@ import (
"path/filepath"
"strconv"
"strings"
"sync"
"kitty"
"kitty/tools/config"
@@ -43,7 +44,7 @@ func read_relevant_kitty_opts(path string) KittyOpts {
return ans
}
var RelevantKittyOpts = utils.Once(func() KittyOpts {
var RelevantKittyOpts = sync.OnceValue(func() KittyOpts {
return read_relevant_kitty_opts(filepath.Join(utils.ConfigDir(), "kitty.conf"))
})