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 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)