Golang : Constant and variable names in native language
Stumbled upon a discussion in Quora about the abilities of Golang. One of them is that Go allows developers to use their own native language and font to identify constants and variables.
I've tried couple of languages with the help of Google Translate. Most will work except for languages from South-Asia( as of Go version 1.4) :
package main
import (
"fmt"
)
func main() {
// Chinese
var 你好 string = "Hi!"
fmt.Println(你好)
// Hebrew
var היי string = "Hi!"
fmt.Println(היי)
// Arabic
const مرحبا = "Hi!"
fmt.Println(مرحبا)
// Greek
var γεια string = "Hi!"
fmt.Println(γεια)
// Japanese
var こんにちは string = "Hi!"
fmt.Println(こんにちは)
// Polish
var cześć string = "Hi!"
fmt.Println(cześć)
// Ukrainian
var привіт string = "Hi!"
fmt.Println(привіт)
// Hindi
// var हाय string = "Hi!" // will cause error
// fmt.Println(हाय)
// Bengali
//var হাই string = "Hi!" // will cause error
//fmt.Println(হাই)
// Gujarati
//var હાય string = "Hi!" // will cause error
//fmt.Println(હાય)
// Tamil
//var வணக்கம் string = "Hi!" // will cause error
//fmt.Println(வணக்கம்)
}
Output :
Hi!
Hi!
Hi!
Hi!
Hi!
Hi!
Hi!
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+35.6k Golang : Get file last modified date and time
+10.9k Golang : How to determine a prime number?
+7k Ubuntu : connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream
+10.6k Golang : Removes punctuation or defined delimiter from the user's input
+6.8k Golang : Levenshtein distance example
+10.3k RPM : error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
+9.4k Golang : Quadratic example
+5.3k Clean up Visual Studio For Mac installation failed disk full problem
+37.2k Upload multiple files with Go
+16.7k Golang : Fix cannot convert buffer (type *bytes.Buffer) to type string error
+6k PHP : How to handle URI or URL with non-ASCII characters such as Chinese/Japanese/Korean(CJK) ?