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

@@ -16,6 +16,7 @@ import (
"path/filepath"
"strconv"
"strings"
"sync"
"kitty/tools/utils"
"kitty/tools/utils/shm"
@@ -264,7 +265,7 @@ func OpenNativeImageFromReader(f io.ReadSeeker) (ans *ImageData, err error) {
return
}
var MagickExe = utils.Once(func() string {
var MagickExe = sync.OnceValue(func() string {
return utils.FindExe("magick")
})