No description
  • Go 94.7%
  • Makefile 5.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-01 10:23:28 +02:00
.github chore(deps): bump the github-actions group with 3 updates (#15) 2026-07-01 10:22:59 +02:00
cmd/asciicheck chore: new module name 2025-08-18 17:36:20 +02:00
testdata refactor: get rid of deprecated ast.Object 2025-02-15 10:34:18 +03:00
.gitignore chore: ci 2025-08-18 17:45:42 +02:00
.golangci.yml chore: quick lint configuration 2025-08-18 17:57:29 +02:00
ascii.go fix: optimize isASCII, remove rune slice casts 2021-10-15 13:00:52 +03:00
ascii_test.go chore: quick lint configuration 2025-08-18 17:57:29 +02:00
asciicheck.go chore: quick lint configuration 2025-08-18 17:57:29 +02:00
asciicheck_test.go Initial commit 2020-04-15 17:01:22 +03:00
go.mod chore(deps): bump golang.org/x/tools from 0.45.0 to 0.46.0 in the go group (#14) 2026-07-01 10:23:28 +02:00
go.sum chore(deps): bump golang.org/x/tools from 0.45.0 to 0.46.0 in the go group (#14) 2026-07-01 10:23:28 +02:00
LICENSE Initial commit 2020-04-15 17:00:56 +03:00
Makefile chore: ci 2025-08-18 17:45:42 +02:00
README.md docs: add some explanation of the situation 2025-08-18 17:47:34 +02:00

asciicheck

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 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 package to run:

asciicheck: checks that all code identifiers does not have non-ASCII symbols in the name

Usage: asciicheck [-flag] [package]


Flags:
  -V	print 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
  -v	no effect (deprecated)