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
+6.3k WARNING: UNPROTECTED PRIVATE KEY FILE! error message
+4.7k Linux/MacOSX : How to symlink a file?
+9k Golang : Get SPF and DMARC from email headers to fight spam
+17.4k Golang : Multi threading or run two processes or more example
+9.6k Golang : Sort and reverse sort a slice of floats
+5.7k Golang : Struct field tags and what is their purpose?
+6.2k Golang : How to get capacity of a slice or array?
+8.5k Golang : How to check variable or object type during runtime?
+29.8k Golang : How to get HTTP request header information?
+4.7k Unix/Linux : How to pipe/save output of a command to file?
+19.6k Golang : Set or Add HTTP Request Headers
+31.6k Golang : Get local IP and MAC address