-
-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(datasources): Properly support aws+sm with args (#2291)
Signed-off-by: Dave Henderson <[email protected]>
- Loading branch information
1 parent
d7e8e19
commit ddc4efb
Showing
2 changed files
with
95 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package datafs | |
|
||
import ( | ||
"context" | ||
"fmt" | ||
"net/http" | ||
"net/http/httptest" | ||
"net/url" | ||
|
@@ -21,64 +22,116 @@ import ( | |
const osWindows = "windows" | ||
|
||
func TestResolveURL(t *testing.T) { | ||
out, err := resolveURL(mustParseURL("http://example.com/foo.json"), "bar.json") | ||
out, err := resolveURL(*mustParseURL("http://example.com/foo.json"), "bar.json") | ||
require.NoError(t, err) | ||
assert.Equal(t, "http://example.com/bar.json", out.String()) | ||
|
||
out, err = resolveURL(mustParseURL("http://example.com/a/b/?n=2"), "bar.json?q=1") | ||
out, err = resolveURL(*mustParseURL("http://example.com/a/b/?n=2"), "bar.json?q=1") | ||
require.NoError(t, err) | ||
assert.Equal(t, "http://example.com/a/b/bar.json?n=2&q=1", out.String()) | ||
|
||
out, err = resolveURL(mustParseURL("git+file:///tmp/myrepo"), "//myfile?type=application/json") | ||
out, err = resolveURL(*mustParseURL("git+file:///tmp/myrepo"), "//myfile?type=application/json") | ||
require.NoError(t, err) | ||
assert.Equal(t, "git+file:///tmp/myrepo//myfile?type=application/json", out.String()) | ||
|
||
out, err = resolveURL(mustParseURL("git+file:///tmp/foo/bar/"), "//myfile?type=application/json") | ||
out, err = resolveURL(*mustParseURL("git+file:///tmp/foo/bar/"), "//myfile?type=application/json") | ||
require.NoError(t, err) | ||
assert.Equal(t, "git+file:///tmp/foo/bar//myfile?type=application/json", out.String()) | ||
|
||
out, err = resolveURL(mustParseURL("git+file:///tmp/myrepo/"), ".//myfile?type=application/json") | ||
out, err = resolveURL(*mustParseURL("git+file:///tmp/myrepo/"), ".//myfile?type=application/json") | ||
require.NoError(t, err) | ||
assert.Equal(t, "git+file:///tmp/myrepo//myfile?type=application/json", out.String()) | ||
|
||
out, err = resolveURL(mustParseURL("git+file:///tmp/repo//foo.txt"), "") | ||
out, err = resolveURL(*mustParseURL("git+file:///tmp/repo//foo.txt"), "") | ||
require.NoError(t, err) | ||
assert.Equal(t, "git+file:///tmp/repo//foo.txt", out.String()) | ||
|
||
out, err = resolveURL(mustParseURL("git+file:///tmp/myrepo"), ".//myfile?type=application/json") | ||
out, err = resolveURL(*mustParseURL("git+file:///tmp/myrepo"), ".//myfile?type=application/json") | ||
require.NoError(t, err) | ||
assert.Equal(t, "git+file:///tmp/myrepo//myfile?type=application/json", out.String()) | ||
|
||
out, err = resolveURL(mustParseURL("git+file:///tmp/myrepo//foo/?type=application/json"), "bar/myfile") | ||
out, err = resolveURL(*mustParseURL("git+file:///tmp/myrepo//foo/?type=application/json"), "bar/myfile") | ||
require.NoError(t, err) | ||
// note that the '/' in the query string is encoded to %2F - that's OK | ||
assert.Equal(t, "git+file:///tmp/myrepo//foo/bar/myfile?type=application%2Fjson", out.String()) | ||
|
||
// both base and relative may not contain "//" | ||
_, err = resolveURL(mustParseURL("git+ssh://[email protected]/foo//bar"), ".//myfile") | ||
_, err = resolveURL(*mustParseURL("git+ssh://[email protected]/foo//bar"), ".//myfile") | ||
require.Error(t, err) | ||
|
||
_, err = resolveURL(mustParseURL("git+ssh://[email protected]/foo//bar"), "baz//myfile") | ||
_, err = resolveURL(*mustParseURL("git+ssh://[email protected]/foo//bar"), "baz//myfile") | ||
require.Error(t, err) | ||
|
||
// relative base URLs must remain relative | ||
out, err = resolveURL(mustParseURL("tmp/foo.json"), "") | ||
out, err = resolveURL(*mustParseURL("tmp/foo.json"), "") | ||
require.NoError(t, err) | ||
assert.Equal(t, "tmp/foo.json", out.String()) | ||
|
||
// relative implicit file URLs without volume or scheme are OK | ||
out, err = resolveURL(mustParseURL("/tmp/"), "foo.json") | ||
out, err = resolveURL(*mustParseURL("/tmp/"), "foo.json") | ||
require.NoError(t, err) | ||
assert.Equal(t, "tmp/foo.json", out.String()) | ||
|
||
// relative base URLs in parent directories are OK | ||
out, err = resolveURL(mustParseURL("../../tmp/foo.json"), "") | ||
out, err = resolveURL(*mustParseURL("../../tmp/foo.json"), "") | ||
require.NoError(t, err) | ||
assert.Equal(t, "../../tmp/foo.json", out.String()) | ||
|
||
out, err = resolveURL(mustParseURL("../../tmp/"), "sub/foo.json") | ||
out, err = resolveURL(*mustParseURL("../../tmp/"), "sub/foo.json") | ||
require.NoError(t, err) | ||
assert.Equal(t, "../../tmp/sub/foo.json", out.String()) | ||
|
||
t.Run("aws+sm", func(t *testing.T) { | ||
out, err = resolveURL(*mustParseURL("aws+sm:"), "foo") | ||
require.NoError(t, err) | ||
assert.Equal(t, "aws+sm:foo", out.String()) | ||
|
||
out, err = resolveURL(*mustParseURL("aws+sm:foo/"), "bar") | ||
require.NoError(t, err) | ||
assert.Equal(t, "aws+sm:foo/bar", out.String()) | ||
|
||
out, err = resolveURL(*mustParseURL("aws+sm:"), "/foo") | ||
require.NoError(t, err) | ||
assert.Equal(t, "aws+sm:///foo", out.String()) | ||
|
||
out, err = resolveURL(*mustParseURL("aws+sm:///foo/"), "bar") | ||
require.NoError(t, err) | ||
assert.Equal(t, "aws+sm:///foo/bar", out.String()) | ||
}) | ||
} | ||
|
||
func BenchmarkResolveURL(b *testing.B) { | ||
args := []struct { | ||
url url.URL | ||
rel string | ||
}{ | ||
{*mustParseURL("http://example.com/foo.json"), "bar.json"}, | ||
{*mustParseURL("http://example.com/a/b/?n=2"), "bar.json?q=1"}, | ||
{*mustParseURL("git+file:///tmp/myrepo"), "//myfile?type=application/json"}, | ||
{*mustParseURL("git+file:///tmp/myrepo2"), ".//myfile?type=application/json"}, | ||
{*mustParseURL("git+file:///tmp/foo/bar/"), "//myfile?type=application/json"}, | ||
{*mustParseURL("git+file:///tmp/myrepo/"), ".//myfile?type=application/json"}, | ||
{*mustParseURL("git+file:///tmp/repo//foo.txt"), ""}, | ||
{*mustParseURL("git+file:///tmp/myrepo//foo/?type=application/json"), "bar/myfile"}, | ||
{*mustParseURL("tmp/foo.json"), ""}, | ||
{*mustParseURL("/tmp/"), "foo.json"}, | ||
{*mustParseURL("../../tmp/foo.json"), ""}, | ||
{*mustParseURL("../../tmp/"), "sub/foo.json"}, | ||
{*mustParseURL("aws+sm:"), "foo"}, | ||
{*mustParseURL("aws+sm:"), "/foo"}, | ||
{*mustParseURL("aws+sm:foo"), "bar"}, | ||
{*mustParseURL("aws+sm:///foo"), "bar"}, | ||
} | ||
|
||
b.ResetTimer() | ||
|
||
for _, a := range args { | ||
b.Run(fmt.Sprintf("base=%s_rel=%s", &a.url, a.rel), func(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
_, _ = resolveURL(a.url, a.rel) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func TestReadFileContent(t *testing.T) { | ||
|
ddc4efb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
BenchmarkFlatten/depth-1_[]int([1_2_3])
170.3
ns/op 168 B/op 5 allocs/op165.7
ns/op 168 B/op 5 allocs/op1.03
BenchmarkFlatten/depth-1_[]int([1_2_3]) - ns/op
170.3
ns/op165.7
ns/op1.03
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])
118.6
ns/op 144 B/op 2 allocs/op117.2
ns/op 144 B/op 2 allocs/op1.01
BenchmarkFlatten/depth-1_[3]int([1_2_3]) - ns/op
118.6
ns/op117.2
ns/op1.01
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.7
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.7
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])
430.2
ns/op 344 B/op 11 allocs/op422.8
ns/op 344 B/op 11 allocs/op1.02
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[1_2]]_3]) - ns/op
430.2
ns/op422.8
ns/op1.02
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])
831.7
ns/op 896 B/op 19 allocs/op791.2
ns/op 896 B/op 19 allocs/op1.05
BenchmarkFlatten/depth-1_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - ns/op
831.7
ns/op791.2
ns/op1.05
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])
117
ns/op 72 B/op 4 allocs/op114.2
ns/op 72 B/op 4 allocs/op1.02
BenchmarkFlatten/depth0_[]int([1_2_3]) - ns/op
117
ns/op114.2
ns/op1.02
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])
64.03
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
64.03
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.331
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.331
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.34
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.34
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.339
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.339
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])
172.2
ns/op 168 B/op 5 allocs/op166.1
ns/op 168 B/op 5 allocs/op1.04
BenchmarkFlatten/depth1_[]int([1_2_3]) - ns/op
172.2
ns/op166.1
ns/op1.04
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])
126.3
ns/op 144 B/op 2 allocs/op116.9
ns/op 144 B/op 2 allocs/op1.08
BenchmarkFlatten/depth1_[3]int([1_2_3]) - ns/op
126.3
ns/op116.9
ns/op1.08
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])
159.3
ns/op 144 B/op 4 allocs/op157.9
ns/op 144 B/op 4 allocs/op1.01
BenchmarkFlatten/depth1_[]interface_{}([[]_[1_2]_3]) - ns/op
159.3
ns/op157.9
ns/op1.01
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])
216.7
ns/op 168 B/op 5 allocs/op210.8
ns/op 168 B/op 5 allocs/op1.03
BenchmarkFlatten/depth1_[]interface_{}([[one]_[[1_2]]_3]) - ns/op
216.7
ns/op210.8
ns/op1.03
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])
144.5
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
144.5
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])
170.2
ns/op 168 B/op 5 allocs/op166.3
ns/op 168 B/op 5 allocs/op1.02
BenchmarkFlatten/depth2_[]int([1_2_3]) - ns/op
170.2
ns/op166.3
ns/op1.02
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])
117.4
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
117.4
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])
211.7
ns/op 208 B/op 5 allocs/op203.9
ns/op 208 B/op 5 allocs/op1.04
BenchmarkFlatten/depth2_[]interface_{}([[]_[1_2]_3]) - ns/op
211.7
ns/op203.9
ns/op1.04
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])
378.9
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
378.9
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])
319.3
ns/op 272 B/op 8 allocs/op324.6
ns/op 272 B/op 8 allocs/op0.98
BenchmarkFlatten/depth2_[]interface_{}([[one]_[[[1]_[2_[3]]]_[4_5]]_6]) - ns/op
319.3
ns/op324.6
ns/op0.98
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])
117.9
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
117.9
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.12
ns/op 48 B/op 1 allocs/op60.15
ns/op 48 B/op 1 allocs/op1.05
BenchmarkInterfaceSlice/[3]int([1_2_3]) - ns/op
63.12
ns/op60.15
ns/op1.05
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])
578.1
ns/op 384 B/op 13 allocs/op536.3
ns/op 384 B/op 13 allocs/op1.08
BenchmarkInterfaceSlice/[]string([foo_bar_baz_foo_bar_baz_foo_bar_baz_foo_bar_baz]) - ns/op
578.1
ns/op536.3
ns/op1.08
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.7
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.7
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.167
ns/op 0 B/op 0 allocs/op2.202
ns/op 0 B/op 0 allocs/op0.98
BenchmarkInterfaceSlice/[]interface_{}([[]_[1_2]_3]) - ns/op
2.167
ns/op2.202
ns/op0.98
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])
66.83
ns/op 48 B/op 1 allocs/op63.17
ns/op 48 B/op 1 allocs/op1.06
BenchmarkInterfaceSlice/[3]interface_{}([[]_[1_2]_3]) - ns/op
66.83
ns/op63.17
ns/op1.06
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
BenchmarkResolveURL/base=http://example.com/foo.json_rel=bar.json
597.1
ns/op 456 B/op 5 allocs/opBenchmarkResolveURL/base=http://example.com/foo.json_rel=bar.json - ns/op
597.1
ns/opBenchmarkResolveURL/base=http://example.com/foo.json_rel=bar.json - B/op
456
B/opBenchmarkResolveURL/base=http://example.com/foo.json_rel=bar.json - allocs/op
5
allocs/opBenchmarkResolveURL/base=git+file:///tmp/repo//foo.txt_rel=
79.72
ns/op 144 B/op 1 allocs/opBenchmarkResolveURL/base=git+file:///tmp/repo//foo.txt_rel= - ns/op
79.72
ns/opBenchmarkResolveURL/base=git+file:///tmp/repo//foo.txt_rel= - B/op
144
B/opBenchmarkResolveURL/base=git+file:///tmp/repo//foo.txt_rel= - allocs/op
1
allocs/opBenchmarkResolveURL/base=tmp/foo.json_rel=
78.7
ns/op 144 B/op 1 allocs/opBenchmarkResolveURL/base=tmp/foo.json_rel= - ns/op
78.7
ns/opBenchmarkResolveURL/base=tmp/foo.json_rel= - B/op
144
B/opBenchmarkResolveURL/base=tmp/foo.json_rel= - allocs/op
1
allocs/opBenchmarkResolveURL/base=/tmp/_rel=foo.json
622.3
ns/op 456 B/op 5 allocs/opBenchmarkResolveURL/base=/tmp/_rel=foo.json - ns/op
622.3
ns/opBenchmarkResolveURL/base=/tmp/_rel=foo.json - B/op
456
B/opBenchmarkResolveURL/base=/tmp/_rel=foo.json - allocs/op
5
allocs/opBenchmarkResolveURL/base=../../tmp/foo.json_rel=
79.08
ns/op 144 B/op 1 allocs/opBenchmarkResolveURL/base=../../tmp/foo.json_rel= - ns/op
79.08
ns/opBenchmarkResolveURL/base=../../tmp/foo.json_rel= - B/op
144
B/opBenchmarkResolveURL/base=../../tmp/foo.json_rel= - allocs/op
1
allocs/opBenchmarkResolveURL/base=../../tmp/_rel=sub/foo.json
1317
ns/op 840 B/op 14 allocs/opBenchmarkResolveURL/base=../../tmp/_rel=sub/foo.json - ns/op
1317
ns/opBenchmarkResolveURL/base=../../tmp/_rel=sub/foo.json - B/op
840
B/opBenchmarkResolveURL/base=../../tmp/_rel=sub/foo.json - allocs/op
14
allocs/opBenchmarkResolveURL/base=aws+sm:_rel=foo
81.74
ns/op 144 B/op 1 allocs/opBenchmarkResolveURL/base=aws+sm:_rel=foo - ns/op
81.74
ns/opBenchmarkResolveURL/base=aws+sm:_rel=foo - B/op
144
B/opBenchmarkResolveURL/base=aws+sm:_rel=foo - allocs/op
1
allocs/opBenchmarkResolveURL/base=aws+sm:_rel=/foo
433.9
ns/op 440 B/op 4 allocs/opBenchmarkResolveURL/base=aws+sm:_rel=/foo - ns/op
433.9
ns/opBenchmarkResolveURL/base=aws+sm:_rel=/foo - B/op
440
B/opBenchmarkResolveURL/base=aws+sm:_rel=/foo - allocs/op
4
allocs/opBenchmarkResolveURL/base=aws+sm:foo_rel=bar
147.6
ns/op 160 B/op 3 allocs/opBenchmarkResolveURL/base=aws+sm:foo_rel=bar - ns/op
147.6
ns/opBenchmarkResolveURL/base=aws+sm:foo_rel=bar - B/op
160
B/opBenchmarkResolveURL/base=aws+sm:foo_rel=bar - allocs/op
3
allocs/opBenchmarkResolveURL/base=aws+sm:///foo_rel=bar
479.4
ns/op 440 B/op 4 allocs/opBenchmarkResolveURL/base=aws+sm:///foo_rel=bar - ns/op
479.4
ns/opBenchmarkResolveURL/base=aws+sm:///foo_rel=bar - B/op
440
B/opBenchmarkResolveURL/base=aws+sm:///foo_rel=bar - allocs/op
4
allocs/opBenchmarkToBytes
1037
ns/op 40 B/op 3 allocs/op1125
ns/op 40 B/op 3 allocs/op0.92
BenchmarkToBytes - ns/op
1037
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.109
ns/op 0 B/op 0 allocs/op3.178
ns/op 0 B/op 0 allocs/op0.98
BenchmarkIsFloat/int(0) - ns/op
3.109
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.097
ns/op 0 B/op 0 allocs/op3.102
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int(1) - ns/op
3.097
ns/op3.102
ns/op1.00
BenchmarkIsFloat/int(1) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int(1) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/int(-1)
3.097
ns/op 0 B/op 0 allocs/op3.135
ns/op 0 B/op 0 allocs/op0.99
BenchmarkIsFloat/int(-1) - ns/op
3.097
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.099
ns/op 0 B/op 0 allocs/op3.097
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/uint(42) - ns/op
3.099
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.102
ns/op 0 B/op 0 allocs/op3.097
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/uint8(255) - ns/op
3.102
ns/op3.097
ns/op1.00
BenchmarkIsFloat/uint8(255) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/uint8(255) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/uint16(42)
3.099
ns/op 0 B/op 0 allocs/op3.102
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/uint16(42) - ns/op
3.099
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.099
ns/op 0 B/op 0 allocs/op3.096
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/uint32(42) - ns/op
3.099
ns/op3.096
ns/op1.00
BenchmarkIsFloat/uint32(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/uint32(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/uint64(42)
3.095
ns/op 0 B/op 0 allocs/op3.101
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/uint64(42) - ns/op
3.095
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.101
ns/op 0 B/op 0 allocs/op3.101
ns/op 0 B/op 0 allocs/op1
BenchmarkIsFloat/int(42) - ns/op
3.101
ns/op3.101
ns/op1
BenchmarkIsFloat/int(42) - B/op
0
B/op0
B/op1
BenchmarkIsFloat/int(42) - allocs/op
0
allocs/op0
allocs/op1
BenchmarkIsFloat/int8(127)
3.099
ns/op 0 B/op 0 allocs/op3.096
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int8(127) - ns/op
3.099
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.1
ns/op 0 B/op 0 allocs/op3.102
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int16(42) - ns/op
3.1
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.095
ns/op 0 B/op 0 allocs/op3.094
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int32(42) - ns/op
3.095
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.096
ns/op 0 B/op 0 allocs/op3.1
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/int64(42) - ns/op
3.096
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.477
ns/op 0 B/op 0 allocs/op2.786
ns/op 0 B/op 0 allocs/op0.89
BenchmarkIsFloat/float32(18.3) - ns/op
2.477
ns/op2.786
ns/op0.89
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.787
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.787
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.785
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.785
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.789
ns/op 0 B/op 0 allocs/op2.789
ns/op 0 B/op 0 allocs/op1
BenchmarkIsFloat/float64(-18.6) - ns/op
2.789
ns/op2.789
ns/op1
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.8
ns/op 0 B/op 0 allocs/op34.1
ns/op 0 B/op 0 allocs/op1.02
BenchmarkIsFloat/string(42) - ns/op
34.8
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.48
ns/op 0 B/op 0 allocs/op38.08
ns/op 0 B/op 0 allocs/op1.01
BenchmarkIsFloat/string(052) - ns/op
38.48
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)
73.87
ns/op 52 B/op 2 allocs/op72.28
ns/op 52 B/op 2 allocs/op1.02
BenchmarkIsFloat/string(0xff) - ns/op
73.87
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.9
ns/op 0 B/op 0 allocs/op35.95
ns/op 0 B/op 0 allocs/op1.03
BenchmarkIsFloat/string(-42) - ns/op
36.9
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.29
ns/op 0 B/op 0 allocs/op32.63
ns/op 0 B/op 0 allocs/op0.99
BenchmarkIsFloat/string(-0) - ns/op
32.29
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)
108.3
ns/op 56 B/op 3 allocs/op105.3
ns/op 56 B/op 3 allocs/op1.03
BenchmarkIsFloat/string(3.14) - ns/op
108.3
ns/op105.3
ns/op1.03
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)
123
ns/op 64 B/op 3 allocs/op112.2
ns/op 64 B/op 3 allocs/op1.10
BenchmarkIsFloat/string(-3.14) - ns/op
123
ns/op112.2
ns/op1.10
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)
105.7
ns/op 56 B/op 3 allocs/op105.8
ns/op 56 B/op 3 allocs/op1.00
BenchmarkIsFloat/string(0.00) - ns/op
105.7
ns/op105.8
ns/op1.00
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)
97.28
ns/op 54 B/op 3 allocs/op93.86
ns/op 54 B/op 3 allocs/op1.04
BenchmarkIsFloat/string(NaN) - ns/op
97.28
ns/op93.86
ns/op1.04
BenchmarkIsFloat/string(NaN) - B/op
54
B/op54
B/op1
BenchmarkIsFloat/string(NaN) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/string(-Inf)
102.2
ns/op 56 B/op 3 allocs/op92.49
ns/op 56 B/op 3 allocs/op1.10
BenchmarkIsFloat/string(-Inf) - ns/op
102.2
ns/op92.49
ns/op1.10
BenchmarkIsFloat/string(-Inf) - B/op
56
B/op56
B/op1
BenchmarkIsFloat/string(-Inf) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/string(+Inf)
100.4
ns/op 56 B/op 3 allocs/op93.17
ns/op 56 B/op 3 allocs/op1.08
BenchmarkIsFloat/string(+Inf) - ns/op
100.4
ns/op93.17
ns/op1.08
BenchmarkIsFloat/string(+Inf) - B/op
56
B/op56
B/op1
BenchmarkIsFloat/string(+Inf) - allocs/op
3
allocs/op3
allocs/op1
BenchmarkIsFloat/string()
50.79
ns/op 48 B/op 1 allocs/op49.84
ns/op 48 B/op 1 allocs/op1.02
BenchmarkIsFloat/string() - ns/op
50.79
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)
71.71
ns/op 51 B/op 2 allocs/op69.53
ns/op 51 B/op 2 allocs/op1.03
BenchmarkIsFloat/string(foo) - ns/op
71.71
ns/op69.53
ns/op1.03
BenchmarkIsFloat/string(foo) - B/op
51
B/op51
B/op1
BenchmarkIsFloat/string(foo) - allocs/op
2
allocs/op2
allocs/op1
BenchmarkIsFloat/bool(true)
3.096
ns/op 0 B/op 0 allocs/op3.097
ns/op 0 B/op 0 allocs/op1.00
BenchmarkIsFloat/bool(true) - ns/op
3.096
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
50232
ns/op 1872 B/op 46 allocs/op50737
ns/op 1840 B/op 44 allocs/op0.99
BenchmarkLookupIPs - ns/op
50232
ns/op50737
ns/op0.99
BenchmarkLookupIPs - B/op
1872
B/op1840
B/op1.02
BenchmarkLookupIPs - allocs/op
46
allocs/op44
allocs/op1.05
BenchmarkIndent
1841
ns/op 2040 B/op 18 allocs/op1946
ns/op 2064 B/op 20 allocs/op0.95
BenchmarkIndent - ns/op
1841
ns/op1946
ns/op0.95
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.