Skip to content

Commit

Permalink
refactor(code): del unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ysicing committed Mar 15, 2024
1 parent fd8c97c commit a85bf33
Show file tree
Hide file tree
Showing 35 changed files with 254 additions and 224 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 1
rebase-strategy: disabled
rebase-strategy: auto
labels:
- bot/dependency
4 changes: 2 additions & 2 deletions cmd/launcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"

commonUtils "github.com/easysoft/zentaoatf/pkg/lib/common"
"github.com/ergoapi/util/zos"
"github.com/fatih/color"
)

Expand All @@ -22,7 +22,7 @@ func main() {

pth := ""
var cmd *exec.Cmd
if commonUtils.IsWin() {
if !zos.IsUnix() {
pth = "gui\\ztf.exe"
cmd = exec.Command("cmd", "/C", "start", pth)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/test/cli/cli_expect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"io/ioutil"
"io"
"os"
"regexp"
"strings"
Expand Down Expand Up @@ -58,7 +58,7 @@ func testExpect() string {
os.Remove(expPath)
}()

content, err := ioutil.ReadAll(file)
content, err := io.ReadAll(file)
checkResSuccess := strings.Contains(string(content), `expect 1
pass
expect 3`)
Expand Down
4 changes: 2 additions & 2 deletions cmd/test/cli/cli_extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"io/ioutil"
"io"
"os"
"regexp"
"strings"
Expand Down Expand Up @@ -51,7 +51,7 @@ func testExtract() string {
return "File can not open"
}
defer file.Close()
content, err := ioutil.ReadAll(file)
content, err := io.ReadAll(file)
checkResSuccess := strings.Contains(string(content), `
title=sync step from comments
timeout=0
Expand Down
6 changes: 3 additions & 3 deletions cmd/test/helper/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package httpHelper
import (
"encoding/json"
"errors"
"io/ioutil"
"io"
"net/http"
"strings"

Expand Down Expand Up @@ -48,7 +48,7 @@ func GetCheckForward(url, token string) (ret []byte, isForward bool, err error)
return
}

ret, err = ioutil.ReadAll(resp.Body)
ret, err = io.ReadAll(resp.Body)
logUtils.InfofIfVerbose("===DEBUG=== response: %s", logUtils.ConvertUnicode(ret))

if err != nil {
Expand Down Expand Up @@ -120,7 +120,7 @@ func PostOrPut(url, token string, method string, data interface{}) (ret []byte,
return
}

ret, err = ioutil.ReadAll(resp.Body)
ret, err = io.ReadAll(resp.Body)
defer resp.Body.Close()

logUtils.InfofIfVerbose("===DEBUG=== response: %s", logUtils.ConvertUnicode(ret))
Expand Down
64 changes: 39 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
module github.com/easysoft/zentaoatf

go 1.21
go 1.22.0

toolchain go1.22.1

require (
github.com/bitly/go-simplejson v0.5.0
github.com/emirpasic/gods v1.18.1
github.com/ergoapi/util v0.6.4
github.com/facebookgo/inject v0.0.0-20180706035515-f23751cae28b
github.com/fatih/color v1.16.0
github.com/fsnotify/fsnotify v1.7.0
Expand All @@ -17,8 +20,8 @@ require (
github.com/iris-contrib/middleware/cors v0.0.0-20210110101738-6d0a4d799b5d
github.com/jameskeane/bcrypt v0.0.0-20120420032655-c3cd44c1e20f
github.com/jinzhu/copier v0.3.5
github.com/kataras/iris/v12 v12.2.0-alpha3
github.com/kataras/neffos v0.0.18
github.com/kataras/iris/v12 v12.2.0
github.com/kataras/neffos v0.0.21
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
github.com/mattn/go-runewidth v0.0.15
github.com/mholt/archiver/v3 v3.5.0
Expand All @@ -43,23 +46,26 @@ require (

require (
dario.cat/mergo v1.0.0 // indirect
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect
github.com/CloudyKit/jet/v6 v6.1.0 // indirect
github.com/Joker/hpp v1.0.0 // indirect
github.com/CloudyKit/jet/v6 v6.2.0 // indirect
github.com/Joker/jade v1.1.3 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/Shopify/goreferrer v0.0.0-20210630161223-536fa16abd6f // indirect
github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
Expand All @@ -71,6 +77,7 @@ require (
github.com/flosch/pongo2/v4 v4.0.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gavv/httpexpect/v2 v2.3.1 // indirect
github.com/getsentry/sentry-go v0.25.0 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
Expand All @@ -80,41 +87,44 @@ require (
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.2.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
github.com/imkira/go-interpol v1.1.0 // indirect
github.com/iris-contrib/go.uuid v2.0.0+incompatible // indirect
github.com/iris-contrib/jade v1.1.4 // indirect
github.com/iris-contrib/schema v0.0.6 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/kataras/blocks v0.0.4 // indirect
github.com/kataras/golog v0.1.7 // indirect
github.com/kataras/pio v0.0.10 // indirect
github.com/kataras/sitemap v0.0.5 // indirect
github.com/kataras/tunnel v0.0.3 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kataras/blocks v0.0.7 // indirect
github.com/kataras/golog v0.1.8 // indirect
github.com/kataras/pio v0.0.11 // indirect
github.com/kataras/sitemap v0.0.6 // indirect
github.com/kataras/tunnel v0.0.4 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/klauspost/pgzip v1.2.4 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lestrrat-go/strftime v1.0.5 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailgun/raymond/v2 v2.0.48 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mediocregopher/radix/v3 v3.6.0 // indirect
github.com/microcosm-cc/bluemonday v1.0.15 // indirect
github.com/mediocregopher/radix/v3 v3.8.1 // indirect
github.com/microcosm-cc/bluemonday v1.0.23 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nats-io/nats.go v1.31.0 // indirect
Expand All @@ -123,32 +133,34 @@ require (
github.com/nwaples/rardecode v1.1.0 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pierrec/lz4/v4 v4.0.3 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/schollz/closestmatch v2.1.0+incompatible // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tdewolff/minify/v2 v2.9.22 // indirect
github.com/tdewolff/parse/v2 v2.5.21 // indirect
github.com/tdewolff/minify/v2 v2.12.4 // indirect
github.com/tdewolff/parse/v2 v2.6.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.30.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.4 // indirect
github.com/valyala/fasthttp v1.40.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
Expand All @@ -160,6 +172,7 @@ require (
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
go.uber.org/multierr v1.11.0 // indirect
go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f // indirect
golang.org/x/mod v0.16.0 // indirect
Expand All @@ -179,4 +192,5 @@ require (
modernc.org/memory v1.7.2 // indirect
modernc.org/sqlite v1.28.0 // indirect
moul.io/http2curl v1.0.1-0.20190925090545-5cd742060b0e // indirect
tailscale.com v1.60.0 // indirect
)
Loading

0 comments on commit a85bf33

Please sign in to comment.