Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simple linter to check that your code does not contain non-ASCII identifiers

License

NotificationsYou must be signed in to change notification settings

golangci/asciicheck

Repository files navigation

Go Report Card

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.

Install

go install github.com/golangci/asciicheck/cmd/asciicheck@latest

Reason to use

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: TestStruct

What?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)

Usage

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

Stars

Watchers

Forks

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp