We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It panics when I check the error type with generics.
I installed errname with following command.
go install github.com/Antonboom/errname@latest
Reproduction code.
package customerror var _ error = (*Error[string])(nil) type Error[T ~string] struct { Code T } func (e *Error[T]) Error() string { return string(e.Code) }
Command result.
$ errname ./... panic: no specification for type goroutine 211 [running]: github.com/Antonboom/errname/pkg/analyzer.run.func3({0x136d2c8?, 0xc00020d590?}) /Users/minoru.takase/pkg/mod/github.com/!antonboom/errname@v0.1.6/pkg/analyzer/analyzer.go:65 +0x174 golang.org/x/tools/go/ast/inspector.(*Inspector).Preorder(0xc0005acd68, {0x14edab0?, 0x1?, 0x117c2cd?}, 0xc000203998) /Users/minoru.takase/pkg/mod/golang.org/x/tools@v0.1.10/go/ast/inspector/inspector.go:77 +0x9a github.com/Antonboom/errname/pkg/analyzer.run(0xc000597520) /Users/minoru.takase/pkg/mod/github.com/!antonboom/errname@v0.1.6/pkg/analyzer/analyzer.go:55 +0x1fd golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0006aa280) /Users/minoru.takase/pkg/mod/golang.org/x/tools@v0.1.10/go/analysis/internal/checker/checker.go:728 +0x9fe sync.(*Once).doSlow(0x0?, 0x1257b60?) /Users/minoru.takase/.asdf/installs/golang/1.18/go/src/sync/once.go:68 +0xc2 sync.(*Once).Do(...) /Users/minoru.takase/.asdf/installs/golang/1.18/go/src/sync/once.go:59 golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0xc00012e420?) /Users/minoru.takase/pkg/mod/golang.org/x/tools@v0.1.10/go/analysis/internal/checker/checker.go:616 +0x3d golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0?) /Users/minoru.takase/pkg/mod/golang.org/x/tools@v0.1.10/go/analysis/internal/checker/checker.go:604 +0x25 created by golang.org/x/tools/go/analysis/internal/checker.execAll /Users/minoru.takase/pkg/mod/golang.org/x/tools@v0.1.10/go/analysis/internal/checker/checker.go:610 +0x165
The text was updated successfully, but these errors were encountered:
Thank u! I'll try to fix this next weekend.
Sorry, something went wrong.
@mnrtks, please check :)
It worked! Thank you!
Successfully merging a pull request may close this issue.
It panics when I check the error type with generics.
I installed errname with following command.
Reproduction code.
Command result.
The text was updated successfully, but these errors were encountered: