Skip to content

Instantly share code, notes, and snippets.

@black-black-cat
Created January 20, 2017 10:42
Show Gist options
  • Save black-black-cat/a927d9b0a1b23b8b25b1b002b02bf536 to your computer and use it in GitHub Desktop.
Save black-black-cat/a927d9b0a1b23b8b25b1b002b02bf536 to your computer and use it in GitHub Desktop.
fmt in go
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