Skip to content

Commit

Permalink
errors.Err
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Feb 10, 2024
1 parent 0181ef8 commit 8d5c718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gopmod/classfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
package gopmod

import (
"errors"
"syscall"

"github.com/goplus/mod/modcache"
"github.com/goplus/mod/modfetch"
"github.com/goplus/mod/modfile"
"github.com/goplus/mod/modload"
"github.com/qiniu/x/errors"
"golang.org/x/mod/module"
)

Expand Down Expand Up @@ -101,7 +101,7 @@ func (p *Module) importMod(modPath string, imcls func(c *Project)) (err error) {
return syscall.ENOENT
}
err = p.importClassFrom(mod, imcls)
if errors.Unwrap(err) != syscall.ENOENT {
if errors.Err(err) != syscall.ENOENT {
return
}
mod, err = modfetch.Get(mod.String())
Expand Down
2 changes: 1 addition & 1 deletion gopmod/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func LoadFrom(gomod, gopmod string) (*Module, error) {
// If we only want to load a Go modfile, pass env parameter as nil.
func LoadMod(mod module.Version) (p *Module, err error) {
p, err = loadModFrom(mod)
if errors.Unwrap(err) != syscall.ENOENT {
if errors.Err(err) != syscall.ENOENT {
return
}
mod, err = modfetch.Get(mod.String())
Expand Down

0 comments on commit 8d5c718

Please sign in to comment.