1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
C:\Users\zhang>godoc fmt
use 'godoc cmd/fmt' for documentation on the fmt command
PACKAGE DOCUMENTATION
package fmt
import "fmt"
...
FUNCTIONS
func Errorf(format string, a ...interface{}) error
Errorf formats according to a format specifier and returns the string as
a value that satisfies error.
func Fprint(w io.Writer, a ...interface{}) (n int, err error)
Fprint formats using the default formats for its operands and writes to
w. Spaces are added between operands when neither is a string. It
returns the number of bytes written and any write error encountered.
func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
Fprintf formats according to a format specifier and writes to w. It
returns the number of bytes written and any write error encountered.
func Fprintln(w io.Writer, a ...interface{}) (n int, err error)
Fprintln formats using the default formats for its operands and writes
to w. Spaces are always added between operands and a newline is
appended. It returns the number of bytes written and any write error
encountered.
func Fscan(r io.Reader, a ...interface{}) (n int, err error)
Fscan scans text read from r, storing successive space-separated values
into successive arguments. Newlines count as space. It returns the
number of items successfully scanned. If that is less than the number of
arguments, err will report why.
func Fscanf(r io.Reader, format string, a ...interface{}) (n int, err error)
Fscanf scans text read from r, storing successive space-separated values
into successive arguments as determined by the format. It returns the
number of items successfully parsed. Newlines in the input must match
newlines in the format.
func Fscanln(r io.Reader, a ...interface{}) (n int, err error)
Fscanln is similar to Fscan, but stops scanning at a newline and after
the final item there must be a newline or EOF.
func Print(a ...interface{}) (n int, err error)
Print formats using the default formats for its operands and writes to
standard output. Spaces are added between operands when neither is a
string. It returns the number of bytes written and any write error
encountered.
func Printf(format string, a ...interface{}) (n int, err error)
Printf formats according to a format specifier and writes to standard
output. It returns the number of bytes written and any write error
encountered.
func Println(a ...interface{}) (n int, err error)
Println formats using the default formats for its operands and writes to
standard output. Spaces are always added between operands and a newline
is appended. It returns the number of bytes written and any write error
encountered.
func Scan(a ...interface{}) (n int, err error)
Scan scans text read from standard input, storing successive
space-separated values into successive arguments. Newlines count as
space. It returns the number of items successfully scanned. If that is
less than the number of arguments, err will report why.
func Scanf(format string, a ...interface{}) (n int, err error)
Scanf scans text read from standard input, storing successive
space-separated values into successive arguments as determined by the
format. It returns the number of items successfully scanned. If that is
less than the number of arguments, err will report why. Newlines in the
input must match newlines in the format. The one exception: the verb %c
always scans the next rune in the input, even if it is a space (or tab
etc.) or newline.
func Scanln(a ...interface{}) (n int, err error)
Scanln is similar to Scan, but stops scanning at a newline and after the
final item there must be a newline or EOF.
func Sprint(a ...interface{}) string
Sprint formats using the default formats for its operands and returns
the resulting string. Spaces are added between operands when neither is
a string.
func Sprintf(format string, a ...interface{}) string
Sprintf formats according to a format specifier and returns the
resulting string.
func Sprintln(a ...interface{}) string
Sprintln formats using the default formats for its operands and returns
the resulting string. Spaces are always added between operands and a
newline is appended.
func Sscan(str string, a ...interface{}) (n int, err error)
Sscan scans the argument string, storing successive space-separated
values into successive arguments. Newlines count as space. It returns
the number of items successfully scanned. If that is less than the
number of arguments, err will report why.
func Sscanf(str string, format string, a ...interface{}) (n int, err error)
Sscanf scans the argument string, storing successive space-separated
values into successive arguments as determined by the format. It returns
the number of items successfully parsed. Newlines in the input must
match newlines in the format.
func Sscanln(str string, a ...interface{}) (n int, err error)
Sscanln is similar to Sscan, but stops scanning at a newline and after
the final item there must be a newline or EOF.
TYPES
type Formatter interface {
Format(f State, c rune)
}
Formatter is the interface implemented by values with a custom
formatter. The implementation of Format may call Sprint(f) or Fprint(f)
etc. to generate its output.
type GoStringer interface {
GoString() string
}
GoStringer is implemented by any value that has a GoString method, which
defines the Go syntax for that value. The GoString method is used to
print values passed as an operand to a %#v format.
...
|