From 769b739b46c14ac828e45814c8bd4c89888e6b28 Mon Sep 17 00:00:00 2001 From: zyrouge Date: Sun, 20 Aug 2023 19:58:57 +0530 Subject: [PATCH 1/5] ci: on workflow dispatch --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1808e39..90a2dfb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,11 @@ name: Go on: + workflow_dispatch: push: branches: [ main ] tags: - v*.* - pull_request: branches: [ main ] @@ -57,7 +57,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '>=1.19' + go-version: '>=1.21' - name: Build run: | From 70532b86344e522dcac7a6fb4bed1b13eb39116f Mon Sep 17 00:00:00 2001 From: zyrouge Date: Sun, 20 Aug 2023 20:04:43 +0530 Subject: [PATCH 2/5] chore: format --- main.go | 10 +++++----- tui/utils.go | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index 604fd4d..4368661 100644 --- a/main.go +++ b/main.go @@ -64,7 +64,7 @@ func main() { Usage: "Use --from as repository slug to fetch from GitHub", }, &cli.BoolFlag{ - Name: "select-first", + Name: "select-first", Usage: "Disable all prompts, and select the first item from the prompt if there are more than one choice.", }, &cli.BoolFlag{ @@ -84,9 +84,9 @@ func main() { }, }, { - Name: "update", - Usage: "Update, downgrade or change a version of an AppImage", - Action: updateAppImageCliContextWrapper, + Name: "update", + Usage: "Update, downgrade or change a version of an AppImage", + Action: updateAppImageCliContextWrapper, Aliases: []string{"u", "downgrade", "switch"}, Flags: []cli.Flag{ &cli.StringFlag{ @@ -95,7 +95,7 @@ func main() { "of the appimage on your system", }, &cli.BoolFlag{ - Name: "select-first", + Name: "select-first", Usage: "Disable all prompts, and select the first item from the prompt if there are more than one choice.", }, &cli.BoolFlag{ diff --git a/tui/utils.go b/tui/utils.go index aad7008..1bf0c1e 100644 --- a/tui/utils.go +++ b/tui/utils.go @@ -34,9 +34,9 @@ func DownloadFileWithProgressBar(url string, destination string, name string) er } f, err := os.OpenFile(destination, os.O_CREATE|os.O_WRONLY, 0755) - if err != nil { - panic(err) - } + if err != nil { + panic(err) + } fmt.Printf("Downloading %s\n", name) logger.Debug("Setting up progressbar") @@ -44,7 +44,7 @@ func DownloadFileWithProgressBar(url string, destination string, name string) er int(resp.ContentLength), "i", ) - mw := io.MultiWriter(f, bar) + mw := io.MultiWriter(f, bar) _, err = io.Copy(mw, resp.Body) if err != nil { panic(err) From 511e8c8281b98838d3c1a204b4b8aabad7e17d14 Mon Sep 17 00:00:00 2001 From: zyrouge Date: Sun, 20 Aug 2023 20:06:08 +0530 Subject: [PATCH 3/5] chore: format --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90a2dfb..5be157b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Go +name: Build on: workflow_dispatch: From 34e72fded09ff1b8d868237da3016bcd614db294 Mon Sep 17 00:00:00 2001 From: zyrouge Date: Sun, 20 Aug 2023 20:43:29 +0530 Subject: [PATCH 4/5] refactor: use saved icons --- appimage/types.go | 18 ++++++++++-------- appimage/utils.go | 11 +++++------ cli.go | 4 ++-- config/config.go | 10 +++++----- daemon/systemd.go | 6 +++--- go.mod | 2 +- go.sum | 28 +++++++++++++++++++++------- index/zap.go | 4 ++-- search/cli.go | 9 +++++---- 9 files changed, 54 insertions(+), 38 deletions(-) diff --git a/appimage/types.go b/appimage/types.go index bc993d8..fc2d324 100644 --- a/appimage/types.go +++ b/appimage/types.go @@ -2,16 +2,16 @@ package appimage import ( "fmt" - "github.com/gabriel-vasile/mimetype" "image" _ "image/png" - "io/ioutil" "os" "os/exec" "path" "path/filepath" "strings" + "github.com/gabriel-vasile/mimetype" + "github.com/AlecAivazis/survey/v2" "github.com/adrg/xdg" "github.com/srevinsaju/zap/config" @@ -53,7 +53,7 @@ func (appimage AppImage) getBaseName() string { * with the apps' basename and png as the Name */ func (appimage *AppImage) ExtractThumbnail(target string) { - dir, err := ioutil.TempDir("", "zap") + dir, err := os.MkdirTemp("", "zap") if err != nil { logger.Debug("Creating temporary directory for thumbnail extraction failed") return @@ -67,7 +67,7 @@ func (appimage *AppImage) ExtractThumbnail(target string) { return } - buf, err := os.Open(dirIcon) + buf, _ := os.Open(dirIcon) logger.Debug("Trying to detect file type of the icon: supports .svg, .png") // move to beginning of the DirIcon, since the image dimensions check might fail @@ -205,7 +205,7 @@ func (appimage AppImage) Extract(dir string, relPath string) string { // with the apps' basename and png as the Name */ func (appimage AppImage) ExtractDesktopFile() ([]byte, error) { - dir, err := ioutil.TempDir("", "zap") + dir, err := os.MkdirTemp("", "zap") if err != nil { logger.Debug("Creating temporary directory for thumbnail extraction failed") return []byte{}, err @@ -215,7 +215,7 @@ func (appimage AppImage) ExtractDesktopFile() ([]byte, error) { logger.Debug("Trying to extract Desktop files") desktopFile := appimage.Extract(dir, "*.desktop") - data, err := ioutil.ReadFile(desktopFile) + data, err := os.ReadFile(desktopFile) if err != nil { logger.Warnf("Reading desktop file failed %s", err) return []byte{}, err @@ -281,10 +281,12 @@ func (appimage *AppImage) ProcessDesktopFile(cfg config.Store) { appImageIcon := desktopEntry.Key("Icon").String() desktopEntry.Key("X-Zap-Id").SetValue(appimage.Executable) + // This does patch https://github.com/srevinsaju/zap/issues/92 + // but, we use zap's saved icon for custom icon theme if cfg.CustomIconTheme { desktopEntry.Key("Icon").SetValue(appImageIcon) } else { - desktopEntry.Key("Icon").SetValue(appimage.Executable) + desktopEntry.Key("Icon").SetValue(appimage.IconPath) } // set the name again, so that the name looks like @@ -297,7 +299,7 @@ func (appimage *AppImage) ProcessDesktopFile(cfg config.Store) { binDir := path.Join(xdg.Home, ".local", "bin") binFile := path.Join(binDir, appimage.Executable) desktopEntry.Key("Exec").SetValue(fmt.Sprintf("%s %%U", binFile)) - desktopEntry.Key("TryExec").SetValue(fmt.Sprintf("%s", binFile)) + desktopEntry.Key("TryExec").SetValue(binFile) tempDesktopDir := path.Join(cfg.LocalStore, "desktop") os.MkdirAll(tempDesktopDir, 0755) diff --git a/appimage/utils.go b/appimage/utils.go index 19c3113..d64b88e 100644 --- a/appimage/utils.go +++ b/appimage/utils.go @@ -6,7 +6,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "os/exec" "path" @@ -148,7 +147,7 @@ func Install(options types.InstallOptions, config config.Store) error { targetAppImagePath := path.Join(config.LocalStore, asset.GetBaseName()) if options.UpdateInplace { - file, _ := ioutil.TempFile(config.LocalStore, "temp*.AppImage") + file, _ := os.CreateTemp(config.LocalStore, "temp*.AppImage") tmpTargetImagePath = targetAppImagePath targetAppImagePath = file.Name() } @@ -221,7 +220,7 @@ func Install(options types.InstallOptions, config config.Store) error { } indexFile = fmt.Sprintf("%s.json", path.Join(config.IndexStore, options.Executable)) logger.Debugf("Writing JSON index to %s", indexFile) - err = ioutil.WriteFile(indexFile, indexBytes, 0644) + err = os.WriteFile(indexFile, indexBytes, 0644) if err != nil { return err } @@ -407,7 +406,7 @@ func update(options types.Options, config config.Store) (*AppImage, error) { } logger.Debugf("Unmarshalling JSON from %s", indexFile) - indexBytes, err := ioutil.ReadFile(indexFile) + indexBytes, err := os.ReadFile(indexFile) if err != nil { return app, err } @@ -499,7 +498,7 @@ func update(options types.Options, config config.Store) (*AppImage, error) { } logger.Debugf("Writing to %s", indexFile) - err = ioutil.WriteFile(indexFile, newIdxBytes, 0644) + err = os.WriteFile(indexFile, newIdxBytes, 0644) if err != nil { return app, err } @@ -547,7 +546,7 @@ func Remove(options types.RemoveOptions, config config.Store) error { bar := tui.NewProgressBar(7, "r") logger.Debugf("Unmarshalling JSON from %s", indexFile) - indexBytes, err := ioutil.ReadFile(indexFile) + indexBytes, err := os.ReadFile(indexFile) if err != nil { return err } diff --git a/cli.go b/cli.go index db94132..bc1cd6f 100644 --- a/cli.go +++ b/cli.go @@ -3,7 +3,7 @@ package main import ( "errors" "fmt" - "io/ioutil" + "io" "net/http" "os" "runtime" @@ -195,7 +195,7 @@ func selfUpdateCliContextWrapper(c *cli.Context) error { fmt.Println("Failed to check for updates.") return err } - newVersionBytes, err := ioutil.ReadAll(r.Body) + newVersionBytes, err := io.ReadAll(r.Body) if err != nil { panic(err) } diff --git a/config/config.go b/config/config.go index e9a7267..9106efd 100644 --- a/config/config.go +++ b/config/config.go @@ -2,14 +2,14 @@ package config import ( "errors" - "github.com/AlecAivazis/survey/v2" - "github.com/srevinsaju/zap/daemon" - "github.com/srevinsaju/zap/internal/helpers" - "io/ioutil" "os" "path/filepath" "strconv" + "github.com/AlecAivazis/survey/v2" + "github.com/srevinsaju/zap/daemon" + "github.com/srevinsaju/zap/internal/helpers" + "github.com/adrg/xdg" "gopkg.in/ini.v1" ) @@ -127,7 +127,7 @@ func NewZapConfig(configPath string) (*Store, error) { } // Init new YAML decode - configRaw, err := ioutil.ReadFile(configPath) + configRaw, err := os.ReadFile(configPath) if err != nil { return nil, err } diff --git a/daemon/systemd.go b/daemon/systemd.go index 59e6f14..30e7d77 100644 --- a/daemon/systemd.go +++ b/daemon/systemd.go @@ -1,13 +1,13 @@ package daemon import ( - "github.com/adrg/xdg" - "io/ioutil" "log" "os" "os/exec" "path" "strings" + + "github.com/adrg/xdg" ) // https://github.com/probonopd/go-appimage/blob/23ad67c727fb762867fe96db06d600a7cdaf297d/src/appimaged/prerequisites.go#L463 @@ -62,7 +62,7 @@ Environment=LAUNCHED_BY_SYSTEMD=1 WantedBy=default.target`) logger.Debugf("Writing zapd.service to %s", pathToServiceDir) - err = ioutil.WriteFile(path.Join(pathToServiceDir, "zapd.service"), systemdService, 0644) + err = os.WriteFile(path.Join(pathToServiceDir, "zapd.service"), systemdService, 0644) if err != nil { return err } diff --git a/go.mod b/go.mod index a9e573a..fa428ad 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,6 @@ require ( github.com/srevinsaju/appimage-update v0.1.5-ss2 github.com/urfave/cli/v2 v2.20.3 github.com/withmandala/go-log v0.1.0 - golang.org/x/crypto v0.1.0 // indirect + golang.org/x/net v0.14.0 // indirect gopkg.in/ini.v1 v1.67.0 ) diff --git a/go.sum b/go.sum index 679d9f8..4966b46 100644 --- a/go.sum +++ b/go.sum @@ -363,8 +363,8 @@ golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -401,6 +401,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -439,8 +440,10 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -465,6 +468,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -519,15 +523,21 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -536,8 +546,11 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -594,6 +607,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/index/zap.go b/index/zap.go index f984211..61be846 100644 --- a/index/zap.go +++ b/index/zap.go @@ -3,7 +3,7 @@ package index import ( "errors" "fmt" - "io/ioutil" + "io" "net/http" "runtime" "strconv" @@ -30,7 +30,7 @@ func GetZapReleases(executable string, config config.Store) (*types.ZapReleases, } defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } diff --git a/search/cli.go b/search/cli.go index 9b25533..2a77653 100644 --- a/search/cli.go +++ b/search/cli.go @@ -3,12 +3,13 @@ package search import ( "encoding/json" "fmt" + "io" + "net/http" + "strings" + "github.com/ktr0731/go-fuzzyfinder" "github.com/srevinsaju/zap/tui" "github.com/srevinsaju/zap/types" - "io/ioutil" - "net/http" - "strings" ) func splitByWidth(str string, size int) []string { @@ -35,7 +36,7 @@ func WithCli(mirror string) error { } defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return err } From 87a9ae53be86d3a48cdda0967fa75618f8467ecf Mon Sep 17 00:00:00 2001 From: zyrouge Date: Sun, 20 Aug 2023 20:58:30 +0530 Subject: [PATCH 5/5] chore: ci deps --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5be157b..2c0ca23 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: ARCH: ['386', 'amd64', 'arm', 'arm64'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0