This is a somewhat non-standard format for error messages in Go. It looks like you are indexing a map index or something. The fmt package has a convenient pattern "%q" which generates quoted strings. It would be better than "[%s]".

Personally I would only call out the offending rune.

```go
fmt.Errorf("unexpected rune '%c'", digit)
```