modulepackage
0.0.0-20240912082639-ac2f74a91666
Repository: https://github.com/warashi/wrapmsg.git
Documentation: pkg.go.dev
# README
wrapmsg
wrapmsg is Go code linter. this enforces fmt.Errorf's message when you wrap error.
Example
// OK 👍🏻
if err := pkg.Cause(); err != nil {
return fmt.Errorf("pkg.Cause: %w", err)
}
// NG 🙅
if err := pkg.Cause(); err != nil {
return fmt.Errorf("cause failed: %w", err)
}
Install
go install github.com/Warashi/wrapmsg/cmd/wrapmsg@latest
Usage
You can use wrapmsg as vettool.
go vet -vettool=$(which wrapmsg) ./...
You can also build your linter with singlechecker or multichecker.
In this way, you can use --fix
option to autocorrect.
package main
import (
"github.com/Warashi/wrapmsg"
"golang.org/x/tools/go/analysis/singlechecker"
)
func main() {
singlechecker.Main(wrapmsg.Analyzer)
}
# Packages
No description provided by the author
# Variables
Analyzer is ...