Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update-codes #19

Merged
merged 2 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions add-tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

/*
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions distribute-readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bufio"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"os"
"reflect"
"sort"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading