diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a7bb8f66..a0c8a2f43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,12 +11,12 @@ jobs: timeout-minutes: 30 strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest, macOS-latest] name: Go ${{ matrix.go }} in ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} - name: Environment @@ -26,7 +26,7 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v3 with: - version: v1.51.2 + version: v1.54.1 only-new-issues: true - name: Test env: diff --git a/.github/workflows/stream_acfun.yml b/.github/workflows/stream_acfun.yml index a8b15041c..44888182b 100644 --- a/.github/workflows/stream_acfun.yml +++ b/.github/workflows/stream_acfun.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_bcy.yml b/.github/workflows/stream_bcy.yml index a3c0d191e..8b34d8984 100644 --- a/.github/workflows/stream_bcy.yml +++ b/.github/workflows/stream_bcy.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_bilibili.yml b/.github/workflows/stream_bilibili.yml index 58cc145db..1c7431451 100644 --- a/.github/workflows/stream_bilibili.yml +++ b/.github/workflows/stream_bilibili.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_douyin.yml b/.github/workflows/stream_douyin.yml index 079d5845b..70673f77e 100644 --- a/.github/workflows/stream_douyin.yml +++ b/.github/workflows/stream_douyin.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_douyu.yml b/.github/workflows/stream_douyu.yml index fd5442c5c..064fea5e2 100644 --- a/.github/workflows/stream_douyu.yml +++ b/.github/workflows/stream_douyu.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_eporner.yml b/.github/workflows/stream_eporner.yml index bc11c940c..8072e659f 100644 --- a/.github/workflows/stream_eporner.yml +++ b/.github/workflows/stream_eporner.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_facebook.yml b/.github/workflows/stream_facebook.yml index 439c2529c..64ca8f0ab 100644 --- a/.github/workflows/stream_facebook.yml +++ b/.github/workflows/stream_facebook.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_geekbang.yml b/.github/workflows/stream_geekbang.yml index c941912b2..bfa44e471 100644 --- a/.github/workflows/stream_geekbang.yml +++ b/.github/workflows/stream_geekbang.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_haokan.yml b/.github/workflows/stream_haokan.yml index 240220a5e..02b35848f 100644 --- a/.github/workflows/stream_haokan.yml +++ b/.github/workflows/stream_haokan.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_hupu.yml b/.github/workflows/stream_hupu.yml index f0f34d6f8..5aa857b74 100644 --- a/.github/workflows/stream_hupu.yml +++ b/.github/workflows/stream_hupu.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_huya.yml b/.github/workflows/stream_huya.yml index c29a3a8af..61fedecdd 100644 --- a/.github/workflows/stream_huya.yml +++ b/.github/workflows/stream_huya.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_instagram.yml b/.github/workflows/stream_instagram.yml index dceef149b..cdec32bc9 100644 --- a/.github/workflows/stream_instagram.yml +++ b/.github/workflows/stream_instagram.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_iqiyi.yml b/.github/workflows/stream_iqiyi.yml index f28d791df..5fb1f3e5d 100644 --- a/.github/workflows/stream_iqiyi.yml +++ b/.github/workflows/stream_iqiyi.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_ixigua.yml b/.github/workflows/stream_ixigua.yml index 5e4d5e109..66eb4f56e 100644 --- a/.github/workflows/stream_ixigua.yml +++ b/.github/workflows/stream_ixigua.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_kuaishou.yml b/.github/workflows/stream_kuaishou.yml index 7fd48399f..43c16a451 100644 --- a/.github/workflows/stream_kuaishou.yml +++ b/.github/workflows/stream_kuaishou.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_mgtv.yml b/.github/workflows/stream_mgtv.yml index 713119f2a..c3c790136 100644 --- a/.github/workflows/stream_mgtv.yml +++ b/.github/workflows/stream_mgtv.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_miaopai.yml b/.github/workflows/stream_miaopai.yml index 75f5505bb..d65244bce 100644 --- a/.github/workflows/stream_miaopai.yml +++ b/.github/workflows/stream_miaopai.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_netease.yml b/.github/workflows/stream_netease.yml index 8f297aa6b..450de6668 100644 --- a/.github/workflows/stream_netease.yml +++ b/.github/workflows/stream_netease.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_pinterest.yml b/.github/workflows/stream_pinterest.yml index 330cddfe1..d4bdfe656 100644 --- a/.github/workflows/stream_pinterest.yml +++ b/.github/workflows/stream_pinterest.yml @@ -7,7 +7,7 @@ on: - ".github/workflows/stream_pinterest.yml" pull_request: paths: - - "extractors/tiktok/*.go" + - "extractors/pinterest/*.go" - ".github/workflows/stream_pinterest.yml" schedule: # run ci weekly @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_pixivision.yml b/.github/workflows/stream_pixivision.yml index 212340d5b..0a75be799 100644 --- a/.github/workflows/stream_pixivision.yml +++ b/.github/workflows/stream_pixivision.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_pornhub.yml b/.github/workflows/stream_pornhub.yml index ae24c42da..302e87a5b 100644 --- a/.github/workflows/stream_pornhub.yml +++ b/.github/workflows/stream_pornhub.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_qq.yml b/.github/workflows/stream_qq.yml index 7801d52b6..43c97676f 100644 --- a/.github/workflows/stream_qq.yml +++ b/.github/workflows/stream_qq.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_reddit.yml b/.github/workflows/stream_reddit.yml index 408e0d8c6..c365da690 100644 --- a/.github/workflows/stream_reddit.yml +++ b/.github/workflows/stream_reddit.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_rumble.yml b/.github/workflows/stream_rumble.yml index 425aff8e7..4aff7a32f 100644 --- a/.github/workflows/stream_rumble.yml +++ b/.github/workflows/stream_rumble.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_streamtape.yml b/.github/workflows/stream_streamtape.yml index 4b8fd9827..545040441 100644 --- a/.github/workflows/stream_streamtape.yml +++ b/.github/workflows/stream_streamtape.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_tangdou.yml b/.github/workflows/stream_tangdou.yml index a43ff2b94..d0a5dae59 100644 --- a/.github/workflows/stream_tangdou.yml +++ b/.github/workflows/stream_tangdou.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_tiktok.yml b/.github/workflows/stream_tiktok.yml index 7f1797a29..ed72302b8 100644 --- a/.github/workflows/stream_tiktok.yml +++ b/.github/workflows/stream_tiktok.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_tumblr.yml b/.github/workflows/stream_tumblr.yml index d621b8b9a..568969d2e 100644 --- a/.github/workflows/stream_tumblr.yml +++ b/.github/workflows/stream_tumblr.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_twitter.yml b/.github/workflows/stream_twitter.yml index 714211975..8c3aa70eb 100644 --- a/.github/workflows/stream_twitter.yml +++ b/.github/workflows/stream_twitter.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_udn.yml b/.github/workflows/stream_udn.yml index 75a2e99c7..8a8f481ad 100644 --- a/.github/workflows/stream_udn.yml +++ b/.github/workflows/stream_udn.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_vimeo.yml b/.github/workflows/stream_vimeo.yml index b8b5d19de..933511330 100644 --- a/.github/workflows/stream_vimeo.yml +++ b/.github/workflows/stream_vimeo.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_vk.yml b/.github/workflows/stream_vk.yml index d243ae821..a8b7c7d31 100644 --- a/.github/workflows/stream_vk.yml +++ b/.github/workflows/stream_vk.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_weibo.yml b/.github/workflows/stream_weibo.yml index 97f40d5bf..9d60def9d 100644 --- a/.github/workflows/stream_weibo.yml +++ b/.github/workflows/stream_weibo.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_ximalaya.yml b/.github/workflows/stream_ximalaya.yml index ad741ea4e..801e29e69 100644 --- a/.github/workflows/stream_ximalaya.yml +++ b/.github/workflows/stream_ximalaya.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_xinpianchang.yml b/.github/workflows/stream_xinpianchang.yml index 34a319f68..0666b6431 100644 --- a/.github/workflows/stream_xinpianchang.yml +++ b/.github/workflows/stream_xinpianchang.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_xvideos.yml b/.github/workflows/stream_xvideos.yml index ffcacb4f8..7ea96fab8 100644 --- a/.github/workflows/stream_xvideos.yml +++ b/.github/workflows/stream_xvideos.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_yinyuetai.yml b/.github/workflows/stream_yinyuetai.yml index 72e498ad7..25bd9fbe1 100644 --- a/.github/workflows/stream_yinyuetai.yml +++ b/.github/workflows/stream_yinyuetai.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_youku.yml b/.github/workflows/stream_youku.yml index 8780b0368..7f736fe12 100644 --- a/.github/workflows/stream_youku.yml +++ b/.github/workflows/stream_youku.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_youtube.yml b/.github/workflows/stream_youtube.yml index ec65160ed..ace30b984 100644 --- a/.github/workflows/stream_youtube.yml +++ b/.github/workflows/stream_youtube.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/.github/workflows/stream_zhihu.yml b/.github/workflows/stream_zhihu.yml index 5f1daec2b..09aca92f1 100644 --- a/.github/workflows/stream_zhihu.yml +++ b/.github/workflows/stream_zhihu.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/extractors/bilibili/bilibili.go b/extractors/bilibili/bilibili.go index 607e71993..b07a87c6d 100644 --- a/extractors/bilibili/bilibili.go +++ b/extractors/bilibili/bilibili.go @@ -3,12 +3,12 @@ package bilibili import ( "encoding/json" "fmt" + "slices" "sort" "strconv" "strings" "time" - "github.com/iawia002/lia/array" "github.com/pkg/errors" "github.com/iawia002/lux/extractors" @@ -158,7 +158,7 @@ func extractBangumi(url, html string, extractOption extractors.Options) ([]*extr wgp := utils.NewWaitGroupPool(extractOption.ThreadNumber) dataIndex := 0 for index, u := range data.EpList { - if !array.ItemInArray(index+1, needDownloadItems) { + if !slices.Contains(needDownloadItems, index+1) { continue } wgp.Add() @@ -259,7 +259,7 @@ func multiEpisodeDownload(url, html string, extractOption extractors.Options, pa wgp := utils.NewWaitGroupPool(extractOption.ThreadNumber) dataIndex := 0 for index, u := range pageData.Sections[0].Episodes { - if !array.ItemInArray(index+1, needDownloadItems) { + if !slices.Contains(needDownloadItems, index+1) { continue } wgp.Add() @@ -288,7 +288,7 @@ func multiPageDownload(url, html string, extractOption extractors.Options, pageD wgp := utils.NewWaitGroupPool(extractOption.ThreadNumber) dataIndex := 0 for index, u := range pageData.VideoData.Pages { - if !array.ItemInArray(index+1, needDownloadItems) { + if !slices.Contains(needDownloadItems, index+1) { continue } wgp.Add() diff --git a/extractors/qq/qq.go b/extractors/qq/qq.go index b7929a349..e21530fba 100644 --- a/extractors/qq/qq.go +++ b/extractors/qq/qq.go @@ -3,10 +3,10 @@ package qq import ( "encoding/json" "fmt" + "slices" "strconv" "strings" - "github.com/iawia002/lia/array" "github.com/pkg/errors" "github.com/iawia002/lux/extractors" @@ -85,7 +85,7 @@ func genStreams(vid, cdn string, data qqVideoInfo) (map[string]*extractors.Strea for _, fi := range data.Fl.Fi { var fmtIDPrefix string var fns []string - if array.ItemInArray(fi.Name, []string{"shd", "fhd"}) { + if slices.Contains([]string{"shd", "fhd"}, fi.Name) { fmtIDPrefix = "p" fmtIDName := fmt.Sprintf("%s%d", fmtIDPrefix, fi.ID%10000) fns = []string{strings.Split(data.Vl.Vi[0].Fn, ".")[0], fmtIDName, "mp4"} diff --git a/extractors/youtube/youtube.go b/extractors/youtube/youtube.go index d9ccde421..c0ba43a2b 100644 --- a/extractors/youtube/youtube.go +++ b/extractors/youtube/youtube.go @@ -3,9 +3,9 @@ package youtube import ( "fmt" "net/http" + "slices" "strconv" - "github.com/iawia002/lia/array" "github.com/kkdai/youtube/v2" "github.com/pkg/errors" @@ -59,7 +59,7 @@ func (e *extractor) Extract(url string, option extractors.Options) ([]*extractor wgp := utils.NewWaitGroupPool(option.ThreadNumber) dataIndex := 0 for index, videoEntry := range playlist.Videos { - if !array.ItemInArray(index+1, needDownloadItems) { + if !slices.Contains(needDownloadItems, index+1) { continue } diff --git a/go.mod b/go.mod index f28d0b6c6..1787dbb5c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/iawia002/lux -go 1.20 +go 1.21 require ( github.com/MercuryEngineering/CookieMonster v0.0.0-20180304172713-1584578b3403 @@ -8,7 +8,6 @@ require ( github.com/cheggaaa/pb/v3 v3.0.8 github.com/dop251/goja v0.0.0-20230304130813-e2f543bf4b4c github.com/fatih/color v1.13.0 - github.com/iawia002/lia v0.1.0 github.com/itchyny/gojq v0.12.7 github.com/json-iterator/go v1.1.12 github.com/kkdai/youtube/v2 v2.7.18 @@ -37,7 +36,6 @@ require ( github.com/rivo/uniseg v0.4.3 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - golang.org/x/exp v0.0.0-20220518171630-0b5c67f07fdf // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect diff --git a/go.sum b/go.sum index ebc3ab0a0..39042ee97 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,7 @@ github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEq github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/cheggaaa/pb/v3 v3.0.8 h1:bC8oemdChbke2FHIIGy9mn4DPJ2caZYQnfbRqwmdCoA= github.com/cheggaaa/pb/v3 v3.0.8/go.mod h1:UICbiLec/XO6Hw6k+BHEtHeQFzzBH4i2/qk/ow1EJTA= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -41,8 +42,6 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= -github.com/iawia002/lia v0.1.0 h1:IzgR5pnOEt3bABB3TtcK5UCXkzcuc7+3GYxT0cVpYfU= -github.com/iawia002/lia v0.1.0/go.mod h1:Jxu7iNh5z17HWuLedH3jwh09aa5SO3g2BI2Ct87aXpY= github.com/itchyny/gojq v0.12.7 h1:hYPTpeWfrJ1OT+2j6cvBScbhl0TkdwGM4bc66onUSOQ= github.com/itchyny/gojq v0.12.7/go.mod h1:ZdvNHVlzPgUf8pgjnuDTmGfHA/21KoutQUJ3An/xNuw= github.com/itchyny/timefmt-go v0.1.3 h1:7M3LGVDsqcd0VZH2U+x393obrzZisp7C0uEe921iRkU= @@ -94,13 +93,12 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/urfave/cli/v2 v2.6.0 h1:yj2Drkflh8X/zUrkWlWlUjZYHyWN7WMmpVxyxXIUyv8= github.com/urfave/cli/v2 v2.6.0/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20220518171630-0b5c67f07fdf h1:oXVg4h2qJDd9htKxb5SCpFBHLipW6hXmL3qpUixS2jw= -golang.org/x/exp v0.0.0-20220518171630-0b5c67f07fdf/go.mod h1:yh0Ynu2b5ZUe3MQfp2nM0ecK7wsgouWTDN0FNeJuIys= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -151,3 +149,4 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/script/github_action_template.yml b/script/github_action_template.yml index bb1fe22d0..5cea30750 100644 --- a/script/github_action_template.yml +++ b/script/github_action_template.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: ["1.20"] + go: ["1.21"] os: [ubuntu-latest] name: ${{ matrix.os }} steps: diff --git a/utils/utils.go b/utils/utils.go index f997fd83d..4c6091ba5 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -11,9 +11,9 @@ import ( "path/filepath" "regexp" "runtime" + "slices" "strings" - "github.com/iawia002/lia/array" "github.com/pkg/errors" "github.com/iawia002/lux/request" @@ -152,7 +152,7 @@ func ParseInputFile(r io.Reader, items string, itemStart, itemEnd int) []string itemList := make([]string, 0, len(wantedItems)) for i, item := range temp { - if array.ItemInArray(i+1, wantedItems) { + if slices.Contains(wantedItems, i+1) { itemList = append(itemList, item) } }