Skip to content

Commit 81230bd

Browse files
committed
chore: 更新依赖库
1 parent 3c27f8b commit 81230bd

File tree

15 files changed

+62
-92
lines changed

15 files changed

+62
-92
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: github/codeql-action/init@v2
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
57+
uses: github/codeql-action/autobuild@v2
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
71+
uses: github/codeql-action/analyze@v2

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ubuntu-latest, macOS-latest, windows-latest]
13-
go: ['1.18.0-beta2']
13+
go: ['1.18.x']
1414

1515
steps:
1616

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## [unreleased]
44

5+
## [v7.2.4]
6+
7+
### Changed
8+
9+
- 仅支持 go1.18 版本;
10+
511
## [v7.2.3]
612

713
### Added

apidoc.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,13 @@ type Config = build.Config
3939
// 如果不调用此函数,则默认会采用 internal/locale.DefaultLocaleID 的值。
4040
// 如果想采用当前系统的本地化信息,可以使用
4141
// github.com/issue9/localeutil.SystemLanguageTag 函数。
42-
func SetLocale(tag language.Tag) {
43-
locale.SetTag(tag)
44-
}
42+
func SetLocale(tag language.Tag) { locale.SetTag(tag) }
4543

4644
// Locale 获取当前设置的本地化 ID
47-
func Locale() language.Tag {
48-
return locale.Tag()
49-
}
45+
func Locale() language.Tag { return locale.Tag() }
5046

5147
// Locales 返回当前所有支持的本地化信息
52-
func Locales() []language.Tag {
53-
return locale.Tags()
54-
}
48+
func Locales() []language.Tag { return locale.Tags() }
5549

5650
// Version 当前程序的版本号
5751
//

core/core.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ func (r Range) Equal(v Range) bool {
7070
}
7171

7272
// IsEmpty 表示 Range 表示的范围长度为空
73-
func (r Range) IsEmpty() bool {
74-
return r.End == r.Start
75-
}
73+
func (r Range) IsEmpty() bool { return r.End == r.Start }
7674

7775
// Contains 是否包含了 p 这个点
7876
func (r Range) Contains(p Position) bool {
@@ -83,9 +81,7 @@ func (r Range) Contains(p Position) bool {
8381
}
8482

8583
// Loc 返回当前的范围
86-
func (l Location) Loc() Location {
87-
return l
88-
}
84+
func (l Location) Loc() Location { return l }
8985

9086
// Contains l 是否包含 pos 这个点
9187
func (l Location) Contains(uri URI, pos Position) bool {

core/message.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,13 @@ func (h *MessageHandler) Locale(t MessageType, key message.Reference, val ...int
9393
}
9494

9595
// Error 发送错误类型的值
96-
func (h *MessageHandler) Error(err interface{}) {
97-
h.Message(Erro, err)
98-
}
96+
func (h *MessageHandler) Error(err interface{}) { h.Message(Erro, err) }
9997

10098
// Warning 发送错误类型的值
101-
func (h *MessageHandler) Warning(err interface{}) {
102-
h.Message(Warn, err)
103-
}
99+
func (h *MessageHandler) Warning(err interface{}) { h.Message(Warn, err) }
104100

105101
// Success 发送错误类型的值
106-
func (h *MessageHandler) Success(err interface{}) {
107-
h.Message(Succ, err)
108-
}
102+
func (h *MessageHandler) Success(err interface{}) { h.Message(Succ, err) }
109103

110104
// Info 发送错误类型的值
111-
func (h *MessageHandler) Info(err interface{}) {
112-
h.Message(Info, err)
113-
}
105+
func (h *MessageHandler) Info(err interface{}) { h.Message(Info, err) }

core/uri.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
package core
44

55
import (
6+
"errors"
7+
"io/fs"
68
"io/ioutil"
79
"net/http"
810
"net/url"
@@ -116,7 +118,7 @@ func (uri URI) Exists() (bool, error) {
116118
switch scheme {
117119
case SchemeFile, "":
118120
_, err := os.Stat(path)
119-
return (err == nil || os.IsExist(err)), nil
121+
return err == nil || errors.Is(err, fs.ErrExist), nil
120122
case SchemeHTTP, SchemeHTTPS:
121123
return remoteFileIsExists(string(uri))
122124
default:

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
module github.com/caixw/apidoc/v7
22

33
require (
4-
github.com/issue9/assert/v2 v2.2.1
4+
github.com/issue9/assert/v2 v2.3.2
55
github.com/issue9/cmdopt v0.7.2
66
github.com/issue9/errwrap v0.2.1
77
github.com/issue9/jsonrpc v0.12.1
8-
github.com/issue9/localeutil v0.9.0
9-
github.com/issue9/mux/v6 v6.0.0-beta.6
8+
github.com/issue9/localeutil v0.12.0
9+
github.com/issue9/mux/v6 v6.1.1
1010
github.com/issue9/qheader v0.5.5
1111
github.com/issue9/rands v1.2.0
12-
github.com/issue9/sliceutil v0.8.0
12+
github.com/issue9/sliceutil v0.10.1
1313
github.com/issue9/source v0.1.2
14-
github.com/issue9/term/v2 v2.1.5
15-
github.com/issue9/validation v0.5.1
14+
github.com/issue9/term/v3 v3.0.0
15+
github.com/issue9/validation v0.6.1
1616
github.com/issue9/version v1.0.5
1717
golang.org/x/text v0.3.7
18-
gopkg.in/yaml.v2 v2.4.0
18+
gopkg.in/yaml.v3 v3.0.0
1919
)
2020

2121
require (
2222
github.com/gorilla/websocket v1.4.2 // indirect
2323
github.com/issue9/autoinc v1.0.8 // indirect
2424
github.com/issue9/unique v1.3.1 // indirect
25-
golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab // indirect
25+
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
2626
)
2727

2828
go 1.18

go.sum

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
22
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
33
github.com/issue9/assert/v2 v2.0.0/go.mod h1:rKr1eVGzXUhAo2af1thiKAhIA8uiSK9Wyn7mcZ4BzAg=
4-
github.com/issue9/assert/v2 v2.2.1 h1:XQEnAFrGiT1Z55Tav39muM/Jg9ECiSLm7ehHQWoCHmA=
54
github.com/issue9/assert/v2 v2.2.1/go.mod h1:rKr1eVGzXUhAo2af1thiKAhIA8uiSK9Wyn7mcZ4BzAg=
5+
github.com/issue9/assert/v2 v2.3.2 h1:J8TxGeak/CvrMchXHjs9CFChsZvpX0hGE/HTnwT6L+8=
6+
github.com/issue9/assert/v2 v2.3.2/go.mod h1:rKr1eVGzXUhAo2af1thiKAhIA8uiSK9Wyn7mcZ4BzAg=
67
github.com/issue9/autoinc v1.0.8 h1:Vpi4ElzJOxyNKqw9wIsvNOSoh1xL9CNOp9vVQzouztI=
78
github.com/issue9/autoinc v1.0.8/go.mod h1:5LsFXszqd49znHXyPng+wFt6TYom5jCZoYNinFoKGgc=
89
github.com/issue9/cmdopt v0.7.2 h1:riBT70kOOU00rKmP4vseFI7hfDZBO0l00FosVcexWH8=
@@ -11,33 +12,33 @@ github.com/issue9/errwrap v0.2.1 h1:hrzBGbOCRs8acitpWSg54xNl2oaLGA/WZEf71bKaiEU=
1112
github.com/issue9/errwrap v0.2.1/go.mod h1:hjjkt9S/owgy48er68ACFfA6YPDO/xax18QE3lsguVQ=
1213
github.com/issue9/jsonrpc v0.12.1 h1:HApT4tU8icb1iRStCidMvQfZvKI4MHZYipsAkPNsDQU=
1314
github.com/issue9/jsonrpc v0.12.1/go.mod h1:uRoxqflqgG/+R9B2Axwsc9OG85TwmdSlJSZwjULwVBc=
14-
github.com/issue9/localeutil v0.9.0 h1:SeNzwzr/t1JfuVGt6xq6NXc/+RyWcLhT7etFIH3gUQc=
15-
github.com/issue9/localeutil v0.9.0/go.mod h1:VDMtz5Y+YJopG+ibgDvrITYkGYC0WxrH20LOWIgTs9g=
16-
github.com/issue9/mux/v6 v6.0.0-beta.6 h1:ZcIt/HEHzplZcYTTmmTMdj49DXrYOpj3Nb5/biFemp8=
17-
github.com/issue9/mux/v6 v6.0.0-beta.6/go.mod h1:UX37BZvI3OEe20S2Jrw6LizgDnqO99NHqGXuVhzZ/7U=
15+
github.com/issue9/localeutil v0.12.0 h1:1YaBHkEs4LwSA/HES+mwW+JAmAvAx209kNEMDRMJIno=
16+
github.com/issue9/localeutil v0.12.0/go.mod h1:QkjGsEjoAqW66rwDZnTjjaUZUE4vQiD8OnxuPX3SbGY=
17+
github.com/issue9/mux/v6 v6.1.1 h1:QV8pWb31nS3BmaOjv5w6GQv9PM5pusVM4ctKzxSsPj8=
18+
github.com/issue9/mux/v6 v6.1.1/go.mod h1:ZYVzLEcesR+Hj/42c78lsFtUWKhSPXG+87j0x+Q9F74=
1819
github.com/issue9/qheader v0.5.5 h1:6LxVoqnxIthEuoZn2rFBGxOdoxN9gh+n1GI1TiGQe4Q=
1920
github.com/issue9/qheader v0.5.5/go.mod h1:oZVXJYWaO2ha6yFlYPrdkTpEpg8InAIRo65fGytoWRo=
2021
github.com/issue9/rands v1.2.0 h1:gXxfhibkFTIhg9M57jsH9BcuCe7rpNMEpuTAzSGr7bk=
2122
github.com/issue9/rands v1.2.0/go.mod h1:Bayx3LQFKasAHNTGVN3APtfeoNATAdNwWUN3b4X8Blw=
2223
github.com/issue9/sliceutil v0.7.1/go.mod h1:8e+l2bD67pBUtV8cVnGChE/Ltlq8czcDLR1pOGCC2tE=
23-
github.com/issue9/sliceutil v0.8.0 h1:a6I3vXPXMXkLw5Vhmz5+cD4kaiO+vWNBzZ/CUJ14slk=
24-
github.com/issue9/sliceutil v0.8.0/go.mod h1:zzOSPwPHTsowvoCCx2RqCxQvPTKsxlb5eaPWWbSNAQ8=
24+
github.com/issue9/sliceutil v0.10.1 h1:zoI2YWYSaAcp1uQUNSiApVVlOHF+wBjTOMrB8AnwIbE=
25+
github.com/issue9/sliceutil v0.10.1/go.mod h1:zzOSPwPHTsowvoCCx2RqCxQvPTKsxlb5eaPWWbSNAQ8=
2526
github.com/issue9/source v0.1.2 h1:Y70bsJOy9ks5MjY9O/3UnYsEu0a6lkzVm2AHQsqOl9c=
2627
github.com/issue9/source v0.1.2/go.mod h1:HPkW33uwl4Kew44lERZ1jzV9Hr+a9Z32IaxgQPJKuPY=
27-
github.com/issue9/term/v2 v2.1.5 h1:qU8C5Y7Zbv7amINkUirs/dtFxislNdW7QGHAuzssOX4=
28-
github.com/issue9/term/v2 v2.1.5/go.mod h1:BA5+fQqPopRYlYfW3+NNmArSsHyPOmrsKksPh34DRdE=
28+
github.com/issue9/term/v3 v3.0.0 h1:MJ0eavCCqZ9lv2souDyCkSDeVo3XM9auqFVE0s2Esos=
29+
github.com/issue9/term/v3 v3.0.0/go.mod h1:D/UzioFydVy7DKLRit8ttJdGDkAa1Ni5fA9ZDWVD3lw=
2930
github.com/issue9/unique v1.3.1 h1:OfM05QsuhKhLrHSUhwTFCBmQaqptwpUk1S5r6xZvaZU=
3031
github.com/issue9/unique v1.3.1/go.mod h1:kXuutx4Mj60iR2/bCk4tAoXqxuO081rxIJjn+MucJRc=
31-
github.com/issue9/validation v0.5.1 h1:olnraMrm4aKqkT60ILUVIJH3alZNLhEU/8NkCQJ7Ab4=
32-
github.com/issue9/validation v0.5.1/go.mod h1:xi4eqjEdtwTXi4wepoyi68tvdYpSYzuU4JyVN9piFXA=
32+
github.com/issue9/validation v0.6.1 h1:sbTiTgQ+RtWRepQTTiE52Ss8yqxBob3y6VG6Q9WYpJQ=
33+
github.com/issue9/validation v0.6.1/go.mod h1:dFQbBVlr2dqd/7AippilmGK/tv/yT3aqtXVsRUIxPl4=
3334
github.com/issue9/version v1.0.5 h1:y4JRHcAM0nXMBju9Vhe13Wv08KP/uNveP4uwg3Wknh8=
3435
github.com/issue9/version v1.0.5/go.mod h1:bgni2RNBbtygajgpVeqBiEXT9JZjkLCuYJ4ceoSXjYo=
35-
golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab h1:rfJ1bsoJQQIAoAxTxB7bme+vHrNkRw8CqfsYh9w54cw=
36-
golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
36+
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 h1:OH54vjqzRWmbJ62fjuhxy7AxFFgoHN0/DPc/UrL8cAs=
37+
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3738
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
3839
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
3940
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
4041
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
4142
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
42-
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
43-
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
43+
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
44+
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/cmd/cmd.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"os"
1111

1212
"github.com/issue9/cmdopt"
13-
"github.com/issue9/term/v2/colors"
13+
"github.com/issue9/term/v3/colors"
1414
"golang.org/x/text/message"
1515

1616
"github.com/caixw/apidoc/v7/core"
@@ -51,22 +51,16 @@ type printer struct {
5151

5252
type uri core.URI
5353

54-
func (u uri) Get() interface{} {
55-
return string(u)
56-
}
54+
func (u uri) Get() interface{} { return string(u) }
5755

5856
func (u *uri) Set(v string) error {
5957
*u = uri(core.FileURI(v))
6058
return nil
6159
}
6260

63-
func (u *uri) String() string {
64-
return core.URI(*u).String()
65-
}
61+
func (u *uri) String() string { return core.URI(*u).String() }
6662

67-
func (u uri) URI() core.URI {
68-
return core.URI(u)
69-
}
63+
func (u uri) URI() core.URI { return core.URI(u) }
7064

7165
// Init 初始化 cmdopt.CmdOpt 实例
7266
func Init(out io.Writer) *cmdopt.CmdOpt {

0 commit comments

Comments
 (0)