Last active
August 1, 2019 13:47
Revisions
-
sahajre revised this gist
Aug 1, 2019 . 1 changed file with 0 additions and 20 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,23 +5,3 @@ import "fmt" func main() { fmt.Println("Hello, 世界") } -
sahajre created this gist
Aug 1, 2019 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ package main import "fmt" func main() { fmt.Println("Hello, 世界") } // To run: go run hello_traditional.go /* Every Go program starts with package clause. The package main tells the compiler to create an executable instead of shared library. func main() is entry level function for code execution. The file defining func main() must have package main declaration. Use import for using in-built or third party packages. In this case, in-built text formatting package is used for printing string "Hello, world" followed by a new line. Go source code is UTF-8 encoded file. i.e. You can use unicode string without any extra support for encoding, decoding. To demonstrate this, I will keep using text "world" translated in Chinese as '世界". In further examples, this will also help to understand difference between string literals vs rune type. */