-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathputs.go
95 lines (73 loc) · 2.23 KB
/
puts.go
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
package ffmt
import (
"io"
)
const colSym = ": "
// Space rune
var Space byte = ' '
// p go style display types for debug
var defD = NewOptional(10, StyleP, CanFilterDuplicate|CanRowSpan)
// D for debug
func D(a ...interface{}) {
MarkStack(1, defD.Sprint(a...))
}
// Sd for debug
func Sd(a ...interface{}) string {
return SmarkStack(1, defD.Sprint(a...))
}
// P go style display types
var defP = NewOptional(5, StyleP, CanDefaultString|CanFilterDuplicate|CanRowSpan)
// Fp The go style friendly display types and data to writer
func Fp(w io.Writer, a ...interface{}) (int, error) {
return defP.Fprint(w, a...)
}
// P The go style friendly display types and data
func P(a ...interface{}) (int, error) {
return defP.Print(a...)
}
// Sp The go style friendly display types and data to string
func Sp(a ...interface{}) string {
return defP.Sprint(a...)
}
// Puts go style
var defPuts = NewOptional(5, StylePuts, CanDefaultString|CanFilterDuplicate|CanRowSpan)
// Fputs The go style friendly to writer
func Fputs(w io.Writer, a ...interface{}) (int, error) {
return defPuts.Fprint(w, a...)
}
// Puts The go style friendly display
func Puts(a ...interface{}) (int, error) {
return defPuts.Print(a...)
}
// Sputs The go style friendly to string
func Sputs(a ...interface{}) string {
return defPuts.Sprint(a...)
}
// Print go style
var defPrint = NewOptional(5, StylePrint, CanDefaultString|CanFilterDuplicate|CanRowSpan)
// Fprint The go style friendly to writer
func Fprint(w io.Writer, a ...interface{}) (int, error) {
return defPrint.Fprint(w, a...)
}
// Print The go style friendly display
func Print(a ...interface{}) (int, error) {
return defPrint.Print(a...)
}
// Sprint The go style friendly to string
func Sprint(a ...interface{}) string {
return defPrint.Sprint(a...)
}
// Pjson json style
var defPjson = NewOptional(20, StylePjson, CanDefaultString|CanRowSpan)
// Fpjson The json style friendly display to writer
func Fpjson(w io.Writer, a ...interface{}) (int, error) {
return defPjson.Fprint(w, a...)
}
// Pjson The json style friendly display
func Pjson(a ...interface{}) (int, error) {
return defPjson.Print(a...)
}
// Spjson The json style friendly display to string
func Spjson(a ...interface{}) string {
return defPjson.Sprint(a...)
}