From 6c7aa1a0a46b0832ca644b00c0eda585a00fbdfa Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Mon, 16 Sep 2024 06:48:39 +0900 Subject: [PATCH 1/2] chore: update Go version to 1.19, 1.20, 1.21, and 1.22 --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 263d13f..86adfe6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ["1.13", "1.14", "1.15"] + go: ["1.19", "1.20", "1.21", "1.22"] steps: - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v2 From aab5355d570cb0e211a0b4472a5997183519219f Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Mon, 16 Sep 2024 06:48:49 +0900 Subject: [PATCH 2/2] chore: Update Go version and fix import statements --- add-tool.go | 8 ++++---- distribute-readme.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/add-tool.go b/add-tool.go index 18bc2b0..0c37759 100644 --- a/add-tool.go +++ b/add-tool.go @@ -5,14 +5,14 @@ import ( "encoding/json" "flag" "fmt" - "golang.org/x/net/html" "io" - "io/ioutil" "net/http" "net/url" "os" "strconv" "strings" + + "golang.org/x/net/html" ) /* @@ -62,7 +62,7 @@ func writeJSON(category, name, method, data, udesc string) { fmt.Println("Successfully Opened data.json") // defer the closing of our jsonFile so that we can parse it later on defer jsonFile.Close() - byteValue, _ := ioutil.ReadAll(jsonFile) + byteValue, _ := io.ReadAll(jsonFile) var result map[string]interface{} install := map[string]string{ "MacOS": "", @@ -96,7 +96,7 @@ func writeJSON(category, name, method, data, udesc string) { } result[name] = tool file, _ := json.MarshalIndent(result, "", " ") - _ = ioutil.WriteFile("data.json", file, 0644) + _ = os.WriteFile("data.json", file, 0644) } func main() { diff --git a/distribute-readme.go b/distribute-readme.go index 50b1830..2326017 100644 --- a/distribute-readme.go +++ b/distribute-readme.go @@ -4,7 +4,7 @@ import ( "bufio" "encoding/json" "fmt" - "io/ioutil" + "io" "os" "reflect" "sort" @@ -56,7 +56,7 @@ func main() { fmt.Println("Successfully Opened data.json") // defer the closing of our dataJson so that we can parse it later on defer dataJson.Close() - byteValue, _ := ioutil.ReadAll(dataJson) + byteValue, _ := io.ReadAll(dataJson) var result map[string]interface{} json.Unmarshal([]byte(byteValue), &result) //result[name] = tool @@ -113,13 +113,13 @@ func main() { fmt.Println(err) } defer dataJson.Close() - head_data, _ := ioutil.ReadAll(top) + head_data, _ := io.ReadAll(top) foot, err := os.Open("template/foot.md") if err != nil { fmt.Println(err) } defer dataJson.Close() - foot_data, _ := ioutil.ReadAll(foot) + foot_data, _ := io.ReadAll(foot) readme = string(head_data) + readme + string(foot_data) fmt.Println("======================result====================") //fmt.Println(readme)