by barsonme · 10y ago · 0 comments
type foo struct {
a int // "private"
B int // "public"
}
You cannot specify default values and Go refers to them as "exported" not private, but technically they are "private" in the sense that they can only be accessed via methods.If that is a concern, you can create a new package for your type.
1. the first character of the identifier's name is a Unicode upper case letter (Unicode class "Lu"); and
2. the identifier is declared in the package block or it is a field name or method name.
All other identifiers are not exported.
https://golang.org/ref/spec#Exported_identifiers
Both of the characters you asked about are lowercase:
http://www.fileformat.info/info/unicode/char/00df/index.htm
http://www.fileformat.info/info/unicode/char/0138/index.htm
Here's the full list of Lu characters:
http://www.fileformat.info/info/unicode/category/Lu/list.htm
An identifier may be exported to permit access to it from another package.
An identifier is exported if both:
the first character of the identifier's name is a Unicode upper case letter (Unicode class "Lu"); and
the identifier is declared in the package block or it is a field name or method name.
All other identifiers are not exported.I know in Japan and Germany it's still kinda common for larger companies to build codebases in local languages.
Which in turn can lead to these issues.