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
+13.7k Golang : convert rune to unicode hexadecimal value and back to rune character
+5.9k Golang : Calculate US Dollar Index (DXY)
+7.5k Golang : get the current working directory of a running program
+9k Golang : Temperatures conversion example
+25.7k Mac/Linux and Golang : Fix bind: address already in use error
+11.4k Golang : Surveillance with web camera and OpenCV
+3.4k Java : Get FX sentiment from website example
+35k Golang : Integer is between a range
+29k Golang : Save map/struct to JSON or XML file
+22.9k Golang : Print out struct values in string format
+9.2k Golang : Extract or copy items from map based on value
+15.3k Golang : Get checkbox or extract multipart form data value example