Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rkoval committed Jan 28, 2023
1 parent b98a91d commit ecd09c4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
3 changes: 1 addition & 2 deletions caching/caching.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package caching

import (
"errors"
"io/ioutil"
"log"
"os"
"strings"
Expand Down Expand Up @@ -70,7 +69,7 @@ func LoadEntityArrayFromCache[K Entity](wf *aw.Workflow, searchArgs searchutil.S
// but that's bad given that we will never be run in AWS. as a result, just populate an error string that informs users better
errString = "NoCredentialProviders"
}
_ = ioutil.WriteFile(lastFetchErrPath, []byte(errString), 0600)
_ = os.WriteFile(lastFetchErrPath, []byte(errString), 0600)
panic(err)
} else {
os.Remove(lastFetchErrPath)
Expand Down
3 changes: 1 addition & 2 deletions caching/fetch_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package caching

import (
"errors"
"io/ioutil"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -53,7 +52,7 @@ func handleExpiredCache(wf *aw.Workflow, cacheName string, lastFetchErrPath stri
}

func handleFetchErr(wf *aw.Workflow, lastFetchErrPath string, searchArgs searchutil.SearchArgs) error {
data, err := ioutil.ReadFile(lastFetchErrPath)
data, err := os.ReadFile(lastFetchErrPath)
if err != nil {
if !os.IsNotExist(err) {
// this file will often not exist, so don't spam logs if it doesn't
Expand Down
6 changes: 3 additions & 3 deletions generators/searchers_by_service_id_sorter/main.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package main

import (
"io/ioutil"
"os"
"sort"
"strings"
)

func main() {
content, err := ioutil.ReadFile("../searchers/searchers_by_service_id.go")
content, err := os.ReadFile("../searchers/searchers_by_service_id.go")
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -36,7 +36,7 @@ func main() {
}
}

err = ioutil.WriteFile("../searchers/searchers_by_service_id.go", []byte(strings.Join(lines, "\n")), 0600)
err = os.WriteFile("../searchers/searchers_by_service_id.go", []byte(strings.Join(lines, "\n")), 0600)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions parsers/yml_parser.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package parsers

import (
"io/ioutil"
"log"
"os"

"github.com/rkoval/alfred-aws-console-services-workflow/awsworkflow"
"gopkg.in/yaml.v2"
)

func ParseConsoleServicesYml(ymlPath string) []awsworkflow.AwsService {
awsServices := []awsworkflow.AwsService{}
yamlFile, err := ioutil.ReadFile(ymlPath)
yamlFile, err := os.ReadFile(ymlPath)
if err != nil {
log.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions workflow/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package workflow
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -250,7 +249,7 @@ func handleOpenAll(wf *aw.Workflow, awsService *awsworkflow.AwsService, allAwsSe
if err != nil {
panic(err)
}
err = ioutil.WriteFile(lastOpenedUrlsPath, urlBytes, 0600)
err = os.WriteFile(lastOpenedUrlsPath, urlBytes, 0600)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit ecd09c4

Please sign in to comment.