Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
Simple linter to check that your code does not contain non-ASCII identifiers
License
golangci/asciicheck
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Simple linter to check that your code does not contain non-ASCII identifiers
The project has been moved to the golangci organization because the GitHub account of the original author (@tdakkota) is no longer available.
go install github.com/golangci/asciicheck/cmd/asciicheck@latest
So, do you see this code? Looks correct, isn't it?
package mainimport"fmt"typeTеstStructstruct{}funcmain() {s:=TestStruct{}fmt.Println(s)}
But if you try to run it, you will get an error:
./prog.go:8:7: undefined: TestStructWhat?TestStruct is defined above, but compiler thinks diffrent. Why?
Answer:
BecauseTestStruct is notTеstStruct.
type TеstStruct struct{} ^ this 'e' (U+0435) is not 'e' (U+0065)asciicheck usessinglechecker package to run:
asciicheck: checks that all code identifiers does not have non-ASCII symbols in the nameUsage: asciicheck [-flag] [package]Flags: -Vprint version and exit -all no effect (deprecated) -c int display offending line with this many lines of context (default -1) -cpuprofile string write CPU profile to this file -debug string debug flags, any subset of "fpstv" -fix apply all suggested fixes -flags print analyzer flags in JSON -json emit JSON output -memprofile string write memory profile to this file -source no effect (deprecated) -tags string no effect (deprecated) -trace string write trace log to this file -vno effect (deprecated)About
Simple linter to check that your code does not contain non-ASCII identifiers
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.