@@ -35,62 +35,86 @@ func setupDatasourcesMergeTest(t *testing.T) (*fs.Dir, *httptest.Server) {
35
35
func TestDatasources_Merge (t * testing.T ) {
36
36
tmpDir , srv := setupDatasourcesMergeTest (t )
37
37
38
- o , e , err := cmd (t ,
39
- "-d" , "user=" + tmpDir .Join ("config.json" ),
40
- "-d" , "default=" + tmpDir .Join ("default.yml" ),
41
- "-d" , "config=merge:user|default" ,
42
- "-i" , `{{ ds "config" | toJSON }}` ,
43
- ).run ()
44
- assertSuccess (t , o , e , err , `{"foo":{"bar":"baz"},"isDefault":false,"isOverride":true,"other":true}` )
45
-
46
- o , e , err = cmd (t ,
47
- "-d" , "default=" + tmpDir .Join ("default.yml" ),
48
- "-d" , "config=merge:user|default" ,
49
- "-i" , `{{ defineDatasource "user" ` + "`" + tmpDir .Join ("config.json" )+ "`" + ` }}{{ ds "config" | toJSON }}` ,
50
- ).run ()
51
- assertSuccess (t , o , e , err , `{"foo":{"bar":"baz"},"isDefault":false,"isOverride":true,"other":true}` )
52
-
53
- o , e , err = cmd (t ,
54
- "-d" , "default=" + tmpDir .Join ("default.yml" ),
55
- "-d" , "config=merge:" + srv .URL + "/foo.json|default" ,
56
- "-i" , `{{ ds "config" | toJSON }}` ,
57
- ).run ()
58
- assertSuccess (t , o , e , err , `{"foo":"bar","isDefault":true,"isOverride":false,"other":true}` )
59
-
60
- o , e , err = cmd (t ,
61
- "-c" , "merged=merge:" + srv .URL + "/2.env|" + srv .URL + "/1.env" ,
62
- "-i" , `FOO is {{ .merged.FOO }}` ,
63
- ).run ()
64
- assertSuccess (t , o , e , err , `FOO is 3` )
65
-
66
- o , e , err = cmd (t ,
67
- "-c" , "default=" + tmpDir .Join ("default.yml" ),
68
- "-i" , `{{ defineDatasource "merged" "merge:` + srv .URL + `/foo.json|default" -}}
38
+ t .Run ("from two aliased datasources" , func (t * testing.T ) {
39
+ o , e , err := cmd (t ,
40
+ "-d" , "user=" + tmpDir .Join ("config.json" ),
41
+ "-d" , "default=" + tmpDir .Join ("default.yml" ),
42
+ "-d" , "config=merge:user|default" ,
43
+ "-i" , `{{ ds "config" | toJSON }}` ,
44
+ ).run ()
45
+ assertSuccess (t , o , e , err , `{"foo":{"bar":"baz"},"isDefault":false,"isOverride":true,"other":true}` )
46
+ })
47
+
48
+ t .Run ("with dynamic datasource" , func (t * testing.T ) {
49
+ o , e , err := cmd (t ,
50
+ "-d" , "default=" + tmpDir .Join ("default.yml" ),
51
+ "-d" , "config=merge:user|default" ,
52
+ "-i" , `{{ defineDatasource "user" ` + "`" + tmpDir .Join ("config.json" )+ "`" + ` }}{{ ds "config" | toJSON }}` ,
53
+ ).run ()
54
+ assertSuccess (t , o , e , err , `{"foo":{"bar":"baz"},"isDefault":false,"isOverride":true,"other":true}` )
55
+ })
56
+
57
+ t .Run ("with inline datasource" , func (t * testing.T ) {
58
+ o , e , err := cmd (t ,
59
+ "-d" , "default=" + tmpDir .Join ("default.yml" ),
60
+ "-d" , "config=merge:" + srv .URL + "/foo.json|default" ,
61
+ "-i" , `{{ ds "config" | toJSON }}` ,
62
+ ).run ()
63
+ assertSuccess (t , o , e , err , `{"foo":"bar","isDefault":true,"isOverride":false,"other":true}` )
64
+ })
65
+
66
+ t .Run ("with two inline env datasources" , func (t * testing.T ) {
67
+ o , e , err := cmd (t ,
68
+ "-c" , "merged=merge:" + srv .URL + "/2.env|" + srv .URL + "/1.env" ,
69
+ "-i" , `FOO is {{ .merged.FOO }}` ,
70
+ ).run ()
71
+ assertSuccess (t , o , e , err , `FOO is 3` )
72
+ })
73
+
74
+ t .Run ("inline merge with inline datasource" , func (t * testing.T ) {
75
+ o , e , err := cmd (t ,
76
+ "-c" , "default=" + tmpDir .Join ("default.yml" ),
77
+ "-i" , `{{ defineDatasource "merged" "merge:` + srv .URL + `/foo.json|default" -}}
69
78
{{ ds "merged" | toJSON }}` ,
70
- ).run ()
71
- assertSuccess (t , o , e , err , `{"foo":"bar","isDefault":true,"isOverride":false,"other":true}` )
72
-
73
- o , e , err = cmd (t ,
74
- "-d" , "default=" + tmpDir .Join ("default.yml" ),
75
- "-d" , "wrongtype=" + srv .URL + "/wrongtype.txt?type=application/json" ,
76
- "-d" , "config=merge:wrongtype|default" ,
77
- "-i" , `{{ ds "config" | toJSON }}` ,
78
- ).run ()
79
- assertSuccess (t , o , e , err , `{"foo":"bar","isDefault":true,"isOverride":false,"other":true}` )
80
-
81
- o , e , err = cmd (t ,
82
- "-d" , "default=" + tmpDir .Join ("default.yml" ),
83
- "-d" , "wrongtype=" + srv .URL + "/wrongtype.txt?_=application/json" ,
84
- "-d" , "config=merge:wrongtype|default" ,
85
- "-i" , `{{ ds "config" | toJSON }}` ,
86
- ).withEnv ("GOMPLATE_TYPE_PARAM" , "_" ).run ()
87
- assertSuccess (t , o , e , err , `{"foo":"bar","isDefault":true,"isOverride":false,"other":true}` )
88
-
89
- o , e , err = cmd (t ,
90
- "-c" , "default=" + tmpDir .Join ("default.yml" ),
91
- "-c" , "params=" + srv .URL + "/params?foo=bar&type=http&_type=application/json" ,
92
- "-c" , "merged=merge:params|default" ,
93
- "-i" , `{{ .merged | toJSON }}` ,
94
- ).withEnv ("GOMPLATE_TYPE_PARAM" , "_type" ).run ()
95
- assertSuccess (t , o , e , err , `{"foo":["bar"],"isDefault":true,"isOverride":false,"other":true,"type":["http"]}` )
79
+ ).run ()
80
+ assertSuccess (t , o , e , err , `{"foo":"bar","isDefault":true,"isOverride":false,"other":true}` )
81
+ })
82
+
83
+ t .Run ("with overridden type" , func (t * testing.T ) {
84
+ o , e , err := cmd (t ,
85
+ "-d" , "default=" + tmpDir .Join ("default.yml" ),
86
+ "-d" , "wrongtype=" + srv .URL + "/wrongtype.txt?type=application/json" ,
87
+ "-d" , "config=merge:wrongtype|default" ,
88
+ "-i" , `{{ ds "config" | toJSON }}` ,
89
+ ).run ()
90
+ assertSuccess (t , o , e , err , `{"foo":"bar","isDefault":true,"isOverride":false,"other":true}` )
91
+ })
92
+
93
+ t .Run ("type overridden by env var" , func (t * testing.T ) {
94
+ o , e , err := cmd (t ,
95
+ "-d" , "default=" + tmpDir .Join ("default.yml" ),
96
+ "-d" , "wrongtype=" + srv .URL + "/wrongtype.txt?_=application/json" ,
97
+ "-d" , "config=merge:wrongtype|default" ,
98
+ "-i" , `{{ ds "config" | toJSON }}` ,
99
+ ).withEnv ("GOMPLATE_TYPE_PARAM" , "_" ).run ()
100
+ assertSuccess (t , o , e , err , `{"foo":"bar","isDefault":true,"isOverride":false,"other":true}` )
101
+
102
+ o , e , err = cmd (t ,
103
+ "-c" , "default=" + tmpDir .Join ("default.yml" ),
104
+ "-c" , "params=" + srv .URL + "/params?foo=bar&type=http&_type=application/json" ,
105
+ "-c" , "merged=merge:params|default" ,
106
+ "-i" , `{{ .merged | toJSON }}` ,
107
+ ).withEnv ("GOMPLATE_TYPE_PARAM" , "_type" ).run ()
108
+ assertSuccess (t , o , e , err , `{"foo":["bar"],"isDefault":true,"isOverride":false,"other":true,"type":["http"]}` )
109
+ })
110
+
111
+ t .Run ("from stdin" , func (t * testing.T ) {
112
+ o , e , err := cmd (t ,
113
+ "-d" , "stdindata=stdin:///in.json" ,
114
+ "-d" , "filedata=" + srv .URL + "/foo.json" ,
115
+ "-d" , "merged=merge:stdindata|filedata" ,
116
+ "-i" , `{{ ds "merged" | toJSON }}` ,
117
+ ).withStdin (`{"baz": "qux"}` ).run ()
118
+ assertSuccess (t , o , e , err , `{"baz":"qux","foo":"bar"}` )
119
+ })
96
120
}
1 commit comments
github-actions[bot] commentedon Dec 16, 2024
Benchmark
BenchmarkFlatten/depth-1_[]int([1_2_3])
171.9
ns/op 168 B/op 5 allocs/op165.7
ns/op 168 B/op 5 allocs/op1.04
BenchmarkFlatten/depth-1_[]int([1_2_3]) - ns/op
171.9
ns/op165.7
ns/op1.04
BenchmarkFlatten/depth-1_[]int([1_2_3]) - B/op
168
B/op168
B/op1
BenchmarkFlatten/depth-1_[]int([1_2_3]) - allocs/op
5
allocs/op5
allocs/op1
BenchmarkFlatten/depth-1_[3]int([1_2_3])
127
ns/op 144 B/op 2 allocs/op117.2
ns/op 144 B/op 2 allocs/op1.08
BenchmarkFlatten/depth-1_[3]int([1_2_3]) - ns/op
127
ns/op117.2
ns/op1.08
BenchmarkFlatten/depth-1_[3]int([1_2_3]) - B/op
144
B/op144
B/op1
BenchmarkFlatten/depth-1_[3]int([1_2_3]) - allocs/op
2
allocs/op2
allocs/op1
BenchmarkFlatten/depth-1_[]interface_{}([[]_[1_2]_3])
205.1
ns/op 208 B/op 5 allocs/op203.4
ns/op 208 B/op 5 allocs/op1.01
BenchmarkFlatten/depth-1_[]interface_{}([[]_[1_2]_3]) - ns/op
205.1
ns/op203.4
ns/op1.01
BenchmarkFlatten/depth-1_[]interface_{}([[]_[1_2]_3]) - B/op
208
B/op208
B/op1
BenchmarkFlatten/depth-1_[]interface_{}([[]_[1_2]_3]) - allocs/op
5
allocs/op5
allocs/op1
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[1_2]]_3])
437
ns/op 344 B/op 11 allocs/op422.8
ns/op 344 B/op 11 allocs/op1.03
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[1_2]]_3]) - ns/op
437
ns/op422.8
ns/op1.03
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[1_2]]_3]) - B/op
344
B/op344
B/op1
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[1_2]]_3]) - allocs/op
11
allocs/op11
allocs/op1
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6])
883.8
ns/op 896 B/op 19 allocs/op791.2
ns/op 896 B/op 19 allocs/op1.12
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - ns/op
883.8
ns/op791.2
ns/op1.12
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - B/op
896
B/op896
B/op1
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - allocs/op
19
allocs/op19
allocs/op1
BenchmarkFlatten/depth0_[]int([1_2_3])
118.2
ns/op 72 B/op 4 allocs/op114.2
ns/op 72 B/op 4 allocs/op1.04
BenchmarkFlatten/depth0_[]int([1_2_3]) - ns/op
118.2
ns/op114.2
ns/op1.04
BenchmarkFlatten/depth0_[]int([1_2_3]) - B/op
72
B/op72
B/op1
BenchmarkFlatten/depth0_[]int([1_2_3]) - allocs/op
4
allocs/op4
allocs/op1
BenchmarkFlatten/depth0_[3]int([1_2_3])
63.67
ns/op 48 B/op 1 allocs/op63.74
ns/op 48 B/op 1 allocs/op1.00
BenchmarkFlatten/depth0_[3]int([1_2_3]) - ns/op
63.67
ns/op63.74
ns/op1.00
BenchmarkFlatten/depth0_[3]int([1_2_3]) - B/op
48
B/op48
B/op1
BenchmarkFlatten/depth0_[3]int([1_2_3]) - allocs/op
1
allocs/op1
allocs/op1
BenchmarkFlatten/depth0_[]interface_{}([[]_[1_2]_3])
4.335
ns/op 0 B/op 0 allocs/op4.33
ns/op 0 B/op 0 allocs/op1.00
BenchmarkFlatten/depth0_[]interface_{}([[]_[1_2]_3]) - ns/op
4.335
ns/op4.33
ns/op1.00
BenchmarkFlatten/depth0_[]interface_{}([[]_[1_2]_3]) - B/op
0
B/op0
B/op1
BenchmarkFlatten/depth0_[]interface_{}([[]_[1_2]_3]) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkFlatten/depth0_[]interface_{}([[one]_[[1_2]]_3])
4.333
ns/op 0 B/op 0 allocs/op4.442
ns/op 0 B/op 0 allocs/op0.98
BenchmarkFlatten/depth0_[]interface_{}([[one]_[[1_2]]_3]) - ns/op
4.333
ns/op4.442
ns/op0.98
BenchmarkFlatten/depth0_[]interface_{}([[one]_[[1_2]]_3]) - B/op
0
B/op0
B/op1
BenchmarkFlatten/depth0_[]interface_{}([[one]_[[1_2]]_3]) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkFlatten/depth0_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6])
4.334
ns/op 0 B/op 0 allocs/op4.301
ns/op 0 B/op 0 allocs/op1.01
BenchmarkFlatten/depth0_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - ns/op
4.334
ns/op4.301
ns/op1.01
BenchmarkFlatten/depth0_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - B/op
0
B/op0
B/op1
BenchmarkFlatten/depth0_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkFlatten/depth1_[]int([1_2_3])
170.9
ns/op 168 B/op 5 allocs/op166.1
ns/op 168 B/op 5 allocs/op1.03
BenchmarkFlatten/depth1_[]int([1_2_3]) - ns/op
170.9
ns/op166.1
ns/op1.03
BenchmarkFlatten/depth1_[]int([1_2_3]) - B/op
168
B/op168
B/op1
BenchmarkFlatten/depth1_[]int([1_2_3]) - allocs/op
5
allocs/op5
allocs/op1
BenchmarkFlatten/depth1_[3]int([1_2_3])
116.9
ns/op 144 B/op 2 allocs/op116.9
ns/op 144 B/op 2 allocs/op1
BenchmarkFlatten/depth1_[3]int([1_2_3]) - ns/op
116.9
ns/op116.9
ns/op1
BenchmarkFlatten/depth1_[3]int([1_2_3]) - B/op
144
B/op144
B/op1
BenchmarkFlatten/depth1_[3]int([1_2_3]) - allocs/op
2
allocs/op2
allocs/op1
BenchmarkFlatten/depth1_[]interface_{}([[]_[1_2]_3])
160.3
ns/op 144 B/op 4 allocs/op157.9
ns/op 144 B/op 4 allocs/op1.02
BenchmarkFlatten/depth1_[]interface_{}([[]_[1_2]_3]) - ns/op
160.3
ns/op157.9
ns/op1.02
BenchmarkFlatten/depth1_[]interface_{}([[]_[1_2]_3]) - B/op
144
B/op144
B/op1
BenchmarkFlatten/depth1_[]interface_{}([[]_[1_2]_3]) - allocs/op
4
allocs/op4
allocs/op1
BenchmarkFlatten/depth1_[]interface_{}([[one]_[[1_2]]_3])
219.6
ns/op 168 B/op 5 allocs/op210.8
ns/op 168 B/op 5 allocs/op1.04
BenchmarkFlatten/depth1_[]interface_{}([[one]_[[1_2]]_3]) - ns/op
219.6
ns/op210.8
ns/op1.04
BenchmarkFlatten/depth1_[]interface_{}([[one]_[[1_2]]_3]) - B/op
168
B/op168
B/op1
BenchmarkFlatten/depth1_[]interface_{}([[one]_[[1_2]]_3]) - allocs/op
5
allocs/op5
allocs/op1
BenchmarkFlatten/depth1_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6])
145
ns/op 128 B/op 3 allocs/op140.6
ns/op 128 B/op 3 allocs/op1.03
BenchmarkFlatten/depth1_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - ns/op
145
ns/op140.6
ns/op1.03
BenchmarkFlatten/depth1_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - B/op
128
B/op128
B/op1
BenchmarkFlatten/depth1_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkFlatten/depth2_[]int([1_2_3])
171.9
ns/op 168 B/op 5 allocs/op166.3
ns/op 168 B/op 5 allocs/op1.03
BenchmarkFlatten/depth2_[]int([1_2_3]) - ns/op
171.9
ns/op166.3
ns/op1.03
BenchmarkFlatten/depth2_[]int([1_2_3]) - B/op
168
B/op168
B/op1
BenchmarkFlatten/depth2_[]int([1_2_3]) - allocs/op
5
allocs/op5
allocs/op1
BenchmarkFlatten/depth2_[3]int([1_2_3])
116.6
ns/op 144 B/op 2 allocs/op116.9
ns/op 144 B/op 2 allocs/op1.00
BenchmarkFlatten/depth2_[3]int([1_2_3]) - ns/op
116.6
ns/op116.9
ns/op1.00
BenchmarkFlatten/depth2_[3]int([1_2_3]) - B/op
144
B/op144
B/op1
BenchmarkFlatten/depth2_[3]int([1_2_3]) - allocs/op
2
allocs/op2
allocs/op1
BenchmarkFlatten/depth2_[]interface_{}([[]_[1_2]_3])
205
ns/op 208 B/op 5 allocs/op203.9
ns/op 208 B/op 5 allocs/op1.01
BenchmarkFlatten/depth2_[]interface_{}([[]_[1_2]_3]) - ns/op
205
ns/op203.9
ns/op1.01
BenchmarkFlatten/depth2_[]interface_{}([[]_[1_2]_3]) - B/op
208
B/op208
B/op1
BenchmarkFlatten/depth2_[]interface_{}([[]_[1_2]_3]) - allocs/op
5
allocs/op5
allocs/op1
BenchmarkFlatten/depth2_[]interface_{}([[one]_[[1_2]]_3])
381.1
ns/op 280 B/op 10 allocs/op368.6
ns/op 280 B/op 10 allocs/op1.03
BenchmarkFlatten/depth2_[]interface_{}([[one]_[[1_2]]_3]) - ns/op
381.1
ns/op368.6
ns/op1.03
BenchmarkFlatten/depth2_[]interface_{}([[one]_[[1_2]]_3]) - B/op
280
B/op280
B/op1
BenchmarkFlatten/depth2_[]interface_{}([[one]_[[1_2]]_3]) - allocs/op
10
allocs/op10
allocs/op1
BenchmarkFlatten/depth2_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6])
323.1
ns/op 272 B/op 8 allocs/op324.6
ns/op 272 B/op 8 allocs/op1.00
BenchmarkFlatten/depth2_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - ns/op
323.1
ns/op324.6
ns/op1.00
BenchmarkFlatten/depth2_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - B/op
272
B/op272
B/op1
BenchmarkFlatten/depth2_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - allocs/op
8
allocs/op8
allocs/op1
BenchmarkInterfaceSlice/[]int([1_2_3])
118.2
ns/op 72 B/op 4 allocs/op112.6
ns/op 72 B/op 4 allocs/op1.05
BenchmarkInterfaceSlice/[]int([1_2_3]) - ns/op
118.2
ns/op112.6
ns/op1.05
BenchmarkInterfaceSlice/[]int([1_2_3]) - B/op
72
B/op72
B/op1
BenchmarkInterfaceSlice/[]int([1_2_3]) - allocs/op
4
allocs/op4
allocs/op1
BenchmarkInterfaceSlice/[3]int([1_2_3])
63.8
ns/op 48 B/op 1 allocs/op60.15
ns/op 48 B/op 1 allocs/op1.06
BenchmarkInterfaceSlice/[3]int([1_2_3]) - ns/op
63.8
ns/op60.15
ns/op1.06
BenchmarkInterfaceSlice/[3]int([1_2_3]) - B/op
48
B/op48
B/op1
BenchmarkInterfaceSlice/[3]int([1_2_3]) - allocs/op
1
allocs/op1
allocs/op1
BenchmarkInterfaceSlice/[]string([foo_bar_baz_foo_bar_baz_foo_bar_baz_foo_bar_baz])
573.1
ns/op 384 B/op 13 allocs/op536.3
ns/op 384 B/op 13 allocs/op1.07
BenchmarkInterfaceSlice/[]string([foo_bar_baz_foo_bar_baz_foo_bar_baz_foo_bar_baz]) - ns/op
573.1
ns/op536.3
ns/op1.07
BenchmarkInterfaceSlice/[]string([foo_bar_baz_foo_bar_baz_foo_bar_baz_foo_bar_baz]) - B/op
384
B/op384
B/op1
BenchmarkInterfaceSlice/[]string([foo_bar_baz_foo_bar_baz_foo_bar_baz_foo_bar_baz]) - allocs/op
13
allocs/op13
allocs/op1
BenchmarkInterfaceSlice/[12]string([foo_bar_baz_foo_bar_baz_foo_bar_baz_foo_bar_baz])
161.5
ns/op 192 B/op 1 allocs/op152.9
ns/op 192 B/op 1 allocs/op1.06
BenchmarkInterfaceSlice/[12]string([foo_bar_baz_foo_bar_baz_foo_bar_baz_foo_bar_baz]) - ns/op
161.5
ns/op152.9
ns/op1.06
BenchmarkInterfaceSlice/[12]string([foo_bar_baz_foo_bar_baz_foo_bar_baz_foo_bar_baz]) - B/op
192
B/op192
B/op1
BenchmarkInterfaceSlice/[12]string([foo_bar_baz_foo_bar_baz_foo_bar_baz_foo_bar_baz]) - allocs/op
1
allocs/op1
allocs/op1
BenchmarkInterfaceSlice/[]interface_{}([[]_[1_2]_3])
2.169
ns/op 0 B/op 0 allocs/op2.202
ns/op 0 B/op 0 allocs/op0.99
BenchmarkInterfaceSlice/[]interface_{}([[]_[1_2]_3]) - ns/op
2.169
ns/op2.202
ns/op0.99
BenchmarkInterfaceSlice/[]interface_{}([[]_[1_2]_3]) - B/op
0
B/op0
B/op1
BenchmarkInterfaceSlice/[]interface_{}([[]_[1_2]_3]) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkInterfaceSlice/[3]interface_{}([[]_[1_2]_3])
69.64
ns/op 48 B/op 1 allocs/op63.17
ns/op 48 B/op 1 allocs/op1.10
BenchmarkInterfaceSlice/[3]interface_{}([[]_[1_2]_3]) - ns/op
69.64
ns/op63.17
ns/op1.10
BenchmarkInterfaceSlice/[3]interface_{}([[]_[1_2]_3]) - B/op
48
B/op48
B/op1
BenchmarkInterfaceSlice/[3]interface_{}([[]_[1_2]_3]) - allocs/op
1
allocs/op1
allocs/op1
BenchmarkToBytes
1035
ns/op 40 B/op 3 allocs/op1125
ns/op 40 B/op 3 allocs/op0.92
BenchmarkToBytes - ns/op
1035
ns/op1125
ns/op0.92
BenchmarkToBytes - B/op
40
B/op40
B/op1
BenchmarkToBytes - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/int(0)
3.1
ns/op 0 B/op 0 allocs/op3.178
ns/op 0 B/op 0 allocs/op0.98
BenchmarkIsFloat/int(0) - ns/op
3.1
ns/op3.178
ns/op0.98
BenchmarkIsFloat/int(0) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int(0) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/int(1)
3.272
ns/op 0 B/op 0 allocs/op3.102
ns/op 0 B/op 0 allocs/op1.05
BenchmarkIsFloat/int(1) - ns/op
3.272
ns/op3.102
ns/op1.05
BenchmarkIsFloat/int(1) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int(1) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/int(-1)
3.112
ns/op 0 B/op 0 allocs/op3.135
ns/op 0 B/op 0 allocs/op0.99
BenchmarkIsFloat/int(-1) - ns/op
3.112
ns/op3.135
ns/op0.99
BenchmarkIsFloat/int(-1) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int(-1) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/uint(42)
3.096
ns/op 0 B/op 0 allocs/op3.097
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/uint(42) - ns/op
3.096
ns/op3.097
ns/op1.00
BenchmarkIsFloat/uint(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/uint(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/uint8(255)
3.165
ns/op 0 B/op 0 allocs/op3.097
ns/op 0 B/op 0 allocs/op1.02
BenchmarkIsFloat/uint8(255) - ns/op
3.165
ns/op3.097
ns/op1.02
BenchmarkIsFloat/uint8(255) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/uint8(255) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/uint16(42)
3.096
ns/op 0 B/op 0 allocs/op3.102
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/uint16(42) - ns/op
3.096
ns/op3.102
ns/op1.00
BenchmarkIsFloat/uint16(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/uint16(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/uint32(42)
3.12
ns/op 0 B/op 0 allocs/op3.096
ns/op 0 B/op 0 allocs/op1.01
BenchmarkIsFloat/uint32(42) - ns/op
3.12
ns/op3.096
ns/op1.01
BenchmarkIsFloat/uint32(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/uint32(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/uint64(42)
3.096
ns/op 0 B/op 0 allocs/op3.101
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/uint64(42) - ns/op
3.096
ns/op3.101
ns/op1.00
BenchmarkIsFloat/uint64(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/uint64(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/int(42)
3.098
ns/op 0 B/op 0 allocs/op3.101
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int(42) - ns/op
3.098
ns/op3.101
ns/op1.00
BenchmarkIsFloat/int(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/int8(127)
3.097
ns/op 0 B/op 0 allocs/op3.096
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int8(127) - ns/op
3.097
ns/op3.096
ns/op1.00
BenchmarkIsFloat/int8(127) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int8(127) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/int16(42)
3.096
ns/op 0 B/op 0 allocs/op3.102
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int16(42) - ns/op
3.096
ns/op3.102
ns/op1.00
BenchmarkIsFloat/int16(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int16(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/int32(42)
3.098
ns/op 0 B/op 0 allocs/op3.094
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int32(42) - ns/op
3.098
ns/op3.094
ns/op1.00
BenchmarkIsFloat/int32(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int32(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/int64(42)
3.095
ns/op 0 B/op 0 allocs/op3.1
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int64(42) - ns/op
3.095
ns/op3.1
ns/op1.00
BenchmarkIsFloat/int64(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int64(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/float32(18.3)
2.785
ns/op 0 B/op 0 allocs/op2.786
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/float32(18.3) - ns/op
2.785
ns/op2.786
ns/op1.00
BenchmarkIsFloat/float32(18.3) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/float32(18.3) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/float64(18.3)
2.79
ns/op 0 B/op 0 allocs/op2.792
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/float64(18.3) - ns/op
2.79
ns/op2.792
ns/op1.00
BenchmarkIsFloat/float64(18.3) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/float64(18.3) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/float64(1.5)
2.792
ns/op 0 B/op 0 allocs/op2.786
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/float64(1.5) - ns/op
2.792
ns/op2.786
ns/op1.00
BenchmarkIsFloat/float64(1.5) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/float64(1.5) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/float64(-18.6)
2.794
ns/op 0 B/op 0 allocs/op2.789
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/float64(-18.6) - ns/op
2.794
ns/op2.789
ns/op1.00
BenchmarkIsFloat/float64(-18.6) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/float64(-18.6) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/string(42)
34.74
ns/op 0 B/op 0 allocs/op34.1
ns/op 0 B/op 0 allocs/op1.02
BenchmarkIsFloat/string(42) - ns/op
34.74
ns/op34.1
ns/op1.02
BenchmarkIsFloat/string(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/string(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/string(052)
38.45
ns/op 0 B/op 0 allocs/op38.08
ns/op 0 B/op 0 allocs/op1.01
BenchmarkIsFloat/string(052) - ns/op
38.45
ns/op38.08
ns/op1.01
BenchmarkIsFloat/string(052) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/string(052) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/string(0xff)
74.06
ns/op 52 B/op 2 allocs/op72.28
ns/op 52 B/op 2 allocs/op1.02
BenchmarkIsFloat/string(0xff) - ns/op
74.06
ns/op72.28
ns/op1.02
BenchmarkIsFloat/string(0xff) - B/op
52
B/op52
B/op1
BenchmarkIsFloat/string(0xff) - allocs/op
2
allocs/op2
allocs/op1
BenchmarkIsFloat/string(-42)
36.88
ns/op 0 B/op 0 allocs/op35.95
ns/op 0 B/op 0 allocs/op1.03
BenchmarkIsFloat/string(-42) - ns/op
36.88
ns/op35.95
ns/op1.03
BenchmarkIsFloat/string(-42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/string(-42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/string(-0)
32.28
ns/op 0 B/op 0 allocs/op32.63
ns/op 0 B/op 0 allocs/op0.99
BenchmarkIsFloat/string(-0) - ns/op
32.28
ns/op32.63
ns/op0.99
BenchmarkIsFloat/string(-0) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/string(-0) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/string(3.14)
106.7
ns/op 56 B/op 3 allocs/op105.3
ns/op 56 B/op 3 allocs/op1.01
BenchmarkIsFloat/string(3.14) - ns/op
106.7
ns/op105.3
ns/op1.01
BenchmarkIsFloat/string(3.14) - B/op
56
B/op56
B/op1
BenchmarkIsFloat/string(3.14) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/string(-3.14)
121.9
ns/op 64 B/op 3 allocs/op112.2
ns/op 64 B/op 3 allocs/op1.09
BenchmarkIsFloat/string(-3.14) - ns/op
121.9
ns/op112.2
ns/op1.09
BenchmarkIsFloat/string(-3.14) - B/op
64
B/op64
B/op1
BenchmarkIsFloat/string(-3.14) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/string(0.00)
104.8
ns/op 56 B/op 3 allocs/op105.8
ns/op 56 B/op 3 allocs/op0.99
BenchmarkIsFloat/string(0.00) - ns/op
104.8
ns/op105.8
ns/op0.99
BenchmarkIsFloat/string(0.00) - B/op
56
B/op56
B/op1
BenchmarkIsFloat/string(0.00) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/string(NaN)
94.62
ns/op 54 B/op 3 allocs/op93.86
ns/op 54 B/op 3 allocs/op1.01
BenchmarkIsFloat/string(NaN) - ns/op
94.62
ns/op93.86
ns/op1.01
BenchmarkIsFloat/string(NaN) - B/op
54
B/op54
B/op1
BenchmarkIsFloat/string(NaN) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/string(-Inf)
97.06
ns/op 56 B/op 3 allocs/op92.49
ns/op 56 B/op 3 allocs/op1.05
BenchmarkIsFloat/string(-Inf) - ns/op
97.06
ns/op92.49
ns/op1.05
BenchmarkIsFloat/string(-Inf) - B/op
56
B/op56
B/op1
BenchmarkIsFloat/string(-Inf) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/string(+Inf)
96.8
ns/op 56 B/op 3 allocs/op93.17
ns/op 56 B/op 3 allocs/op1.04
BenchmarkIsFloat/string(+Inf) - ns/op
96.8
ns/op93.17
ns/op1.04
BenchmarkIsFloat/string(+Inf) - B/op
56
B/op56
B/op1
BenchmarkIsFloat/string(+Inf) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/string()
50.73
ns/op 48 B/op 1 allocs/op49.84
ns/op 48 B/op 1 allocs/op1.02
BenchmarkIsFloat/string() - ns/op
50.73
ns/op49.84
ns/op1.02
BenchmarkIsFloat/string() - B/op
48
B/op48
B/op1
BenchmarkIsFloat/string() - allocs/op
1
allocs/op1
allocs/op1
BenchmarkIsFloat/string(foo)
72.12
ns/op 51 B/op 2 allocs/op69.53
ns/op 51 B/op 2 allocs/op1.04
BenchmarkIsFloat/string(foo) - ns/op
72.12
ns/op69.53
ns/op1.04
BenchmarkIsFloat/string(foo) - B/op
51
B/op51
B/op1
BenchmarkIsFloat/string(foo) - allocs/op
2
allocs/op2
allocs/op1
BenchmarkIsFloat/bool(true)
3.099
ns/op 0 B/op 0 allocs/op3.097
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/bool(true) - ns/op
3.099
ns/op3.097
ns/op1.00
BenchmarkIsFloat/bool(true) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/bool(true) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkLookupIPs
48468
ns/op 1872 B/op 46 allocs/op50737
ns/op 1840 B/op 44 allocs/op0.96
BenchmarkLookupIPs - ns/op
48468
ns/op50737
ns/op0.96
BenchmarkLookupIPs - B/op
1872
B/op1840
B/op1.02
BenchmarkLookupIPs - allocs/op
46
allocs/op44
allocs/op1.05
BenchmarkIndent
1837
ns/op 2040 B/op 18 allocs/op1946
ns/op 2064 B/op 20 allocs/op0.94
BenchmarkIndent - ns/op
1837
ns/op1946
ns/op0.94
BenchmarkIndent - B/op
2040
B/op2064
B/op0.99
BenchmarkIndent - allocs/op
18
allocs/op20
allocs/op0.90
This comment was automatically generated by workflow using github-action-benchmark.