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
+16.1k Golang : How to login and logout with JWT example
+9.7k Golang : How to extract video or image files from html source code
+8.4k Golang : Get final or effective URL with Request.URL example
+7.5k Golang : Scanf function weird error in Windows
+11.8k Golang : Display a text file line by line with line number example
+5.5k How to check with curl if my website or the asset is gzipped ?
+22k Golang : Upload big file (larger than 100MB) to AWS S3 with multipart upload
+29.5k Golang : Save map/struct to JSON or XML file
+18.2k Golang : Check if a directory exist or not
+5.9k Golang : List all packages and search for certain package
+11.8k Golang : Concurrency and goroutine example
+4.9k Golang : A program that contain another program and executes it during run-time