Created
January 20, 2017 10:42
-
-
Save black-black-cat/a927d9b0a1b23b8b25b1b002b02bf536 to your computer and use it in GitHub Desktop.
fmt in go
This file contains hidden or 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() { | |
| fmt.Println("Hello, World", "!") // 参数以空格分隔 | |
| fmt.Print(1, 2, 3, "a", "\n") // 非字符串参数以空格分隔 | |
| fmt.Printf("%s, %s! %d", "Hello", "World", 12) // 第一个字符串是标准字符串,将后面的参数填充到标准字符串中 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment