Skip to content

Commit 76b1385

Browse files
committed
chore: 更新依赖项
1 parent c18c2d8 commit 76b1385

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.github/workflows/go.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.21.x', '1.22.x']
13+
go: ['1.21.x', '1.23.x']
1414

1515
steps:
1616

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ go 1.21
55
require (
66
github.com/issue9/assert/v4 v4.3.0
77
github.com/issue9/errwrap v0.3.2
8-
golang.org/x/mod v0.17.0
8+
golang.org/x/mod v0.20.0
99
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ github.com/issue9/assert/v4 v4.3.0 h1:W3XDKmttsfzihYGxJ9rJoL2ViJgWERB9IxfHcxjv65
22
github.com/issue9/assert/v4 v4.3.0/go.mod h1:v7qDRXi7AsaZZNh8eAK2rkLJg5/clztqQGA1DRv9Lv4=
33
github.com/issue9/errwrap v0.3.2 h1:7KEme9Pfe75M+sIMcPCn/DV90wjnOcRbO4DXVAHj3Fw=
44
github.com/issue9/errwrap v0.3.2/go.mod h1:KcCLuUGiffjooLCUjL89r1cyO8/HT/VRcQrneO53N3A=
5-
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
6-
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
5+
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
6+
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=

mod.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ var (
3030
// 如果 pkgPath 是标准库的名称,如 encoding/json 等,则返回当前使用的 Go 版本对应的标准库地址。
3131
// 其它情况则从 modDir 指向的 go.mod 中查找 require 或是 replace 字段的定义,
3232
// 并根据这些定义找到其指向的源码路径。
33+
// 如果 modDir 中不存在 go.mod 会尝试向上一级目录查找。
3334
//
34-
// pkgPath 需要查找的包路径,如果指向的是模块下的包级别的导出路径,则会尝试使用 strings.HasPrefix 与 require 指令进行对比;
35+
// pkgPath 需要查找的包路径,如果指向的是模块下的包级别的导出路径,则会尝试使用 [strings.HasPrefix] 与 require 指令进行对比;
3536
// modDir go.mod 所在的目录,将在该文件中查找 pkgPath 指定的目录;
3637
// replace 是否考虑 go.mod 中的 replace 指令的影响;
3738
//
39+
// 如果找不到,会返回 [fs.ErrNotExist]
40+
//
3841
// NOTE: 这并不会检测 dir 指向目录是否真实且准确。
3942
func PkgSourceDir(pkgPath, modDir string, replace bool) (dir string, err error) {
4043
if strings.IndexByte(pkgPath, '.') < 0 {

0 commit comments

Comments
 (0)