diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-09-15 18:05:35 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-09-15 19:34:30 +0200 |
| commit | 712de1c63d9db97c81af68cd0dc4372c53d2e57a (patch) | |
| tree | ae1761fec52c3ae4ddd003a4130ddbda8d0a2d69 /vendor/github.com/tdakkota | |
| parent | 298a69c38dd5c8a9bbd7a022e88f4ddbcf885e16 (diff) | |
vendor/github.com/golangci/golangci-lint: update to v1.31
Diffstat (limited to 'vendor/github.com/tdakkota')
| -rw-r--r-- | vendor/github.com/tdakkota/asciicheck/README.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/github.com/tdakkota/asciicheck/README.md b/vendor/github.com/tdakkota/asciicheck/README.md index fc62811be..a7ff5884f 100644 --- a/vendor/github.com/tdakkota/asciicheck/README.md +++ b/vendor/github.com/tdakkota/asciicheck/README.md @@ -7,6 +7,34 @@ Simple linter to check that your code does not contain non-ASCII identifiers go get -u github.com/tdakkota/asciicheck/cmd/asciicheck ``` +# Reason to use +So, do you see this code? Looks correct, isn't it? + +```go +package main + +import "fmt" + +type TеstStruct struct{} + +func main() { + s := TestStruct{} + fmt.Println(s) +} +``` +But if you try to run it, you will get an error: +``` +./prog.go:8:7: undefined: TestStruct +``` +What? `TestStruct` is defined above, but compiler thinks diffrent. Why? + +**Answer**: +Because `TestStruct` is not `TеstStruct`. +``` +type TеstStruct struct{} + ^ this 'e' (U+0435) is not 'e' (U+0065) +``` + # Usage asciicheck uses [`singlechecker`](https://pkg.go.dev/golang.org/x/tools/go/analysis/singlechecker) package to run: |
