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 characters
package main | |
import "fmt" | |
func main() { | |
var s = [9]rune{ | |
'H', 'e', 'l', 'l', 'o', ',', ' ', '世', '界', | |
} | |
for i := 0; i < len(s); i++ { |
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 characters
package main | |
import "fmt" | |
func main() { | |
m := make(chan string, 2) | |
m <- "Hello, " | |
m <- "世界" |
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 characters
package main | |
import "fmt" | |
func getGreetingByteSeq() func() (byte, bool) { | |
i := 0 | |
s := "Hello, 世界" | |
return func() (byte, bool) { | |
i++ |
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 characters
// package main includes the main function of Go program | |
package main | |
import "fmt" | |
/* this program demonstrates line comment using // above | |
and this block comment in Go programs */ | |
func main() { | |
fmt.Println("Hello, 世界") |
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 characters
package main | |
import "fmt" | |
func main() { | |
ch := make(chan string) | |
go func() { | |
ch <- "Hello, 世界" | |
}() |
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 characters
package main | |
import "fmt" | |
func main() { | |
const s = "Hello, 世界" | |
fmt.Println(s) | |
} |
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 characters
package main | |
import "fmt" | |
func main() { | |
const s = "Hello, 世界" | |
fmt.Println(s) | |
} |
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 characters
package main | |
import "fmt" | |
func printStr(s string) { | |
fmt.Print(s) | |
} | |
func printHelloWorld() { | |
defer printStr("界") |
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 characters
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
func createError() error { | |
return errors.New("Hello, 世界") | |
} |
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 characters
package main | |
import "fmt" | |
func main() { | |
for i := 0; i < 1; i++ { | |
fmt.Println("Hello, 世界") | |
} | |
} |
OlderNewer