Skip to content

Commit

Permalink
Merge pull request #19 from hahwul/update-codes
Browse files Browse the repository at this point in the history
Update-codes
  • Loading branch information
hahwul authored Sep 15, 2024
2 parents c7cc07e + aab5355 commit 046fa6f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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

0 comments on commit 046fa6f

Please sign in to comment.