Skip to content

Commit 4ba7e4d

Browse files
committed
Refactor to make lint comply
1 parent 28985b7 commit 4ba7e4d

File tree

17 files changed

+412
-554
lines changed

17 files changed

+412
-554
lines changed

go.mod

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/apache/arrow/go/v8 v8.0.0
77
github.com/bufbuild/connect-go v0.1.0
88
github.com/bufbuild/connect-grpchealth-go v0.1.0
9-
github.com/dgraph-io/badger/v3 v3.2103.2
9+
github.com/cespare/xxhash/v2 v2.1.2
1010
github.com/drone/envsubst v1.0.3
1111
github.com/go-kit/log v0.2.1
1212
github.com/gogo/status v1.1.0
@@ -15,7 +15,6 @@ require (
1515
github.com/grafana/dskit v0.0.0-20220526081034-789ec0ca4a3b
1616
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
1717
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3
18-
github.com/hashicorp/go-multierror v1.1.1
1918
github.com/opentracing/opentracing-go v1.2.0
2019
github.com/parca-dev/parca v0.11.1-0.20220628070043-1c1a82d2d7bd
2120
github.com/pkg/errors v0.9.1
@@ -26,7 +25,6 @@ require (
2625
github.com/pyroscope-io/pyroscope v0.18.0
2726
github.com/segmentio/parquet-go v0.0.0-20220623195409-8b4d4260d8cb
2827
github.com/stretchr/testify v1.7.5
29-
github.com/thanos-io/objstore v0.0.0-20220324141029-c4f11442aa33
3028
github.com/thanos-io/thanos v0.26.0
3129
github.com/weaveworks/common v0.0.0-20220428113342-f83ccc76d823
3230
github.com/xlab/treeprint v1.1.0
@@ -87,7 +85,6 @@ require (
8785
github.com/beorn7/perks v1.0.1 // indirect
8886
github.com/bits-and-blooms/bitset v1.2.0 // indirect
8987
github.com/cespare/xxhash v1.1.0 // indirect
90-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
9188
github.com/clbanning/mxj v1.8.4 // indirect
9289
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 // indirect
9390
github.com/containerd/containerd v1.6.1 // indirect
@@ -137,7 +134,6 @@ require (
137134
github.com/golang/protobuf v1.5.2 // indirect
138135
github.com/golang/snappy v0.0.4 // indirect
139136
github.com/google/btree v1.0.1 // indirect
140-
github.com/google/flatbuffers v2.0.5+incompatible // indirect
141137
github.com/google/gnostic v0.5.7-v3refs // indirect
142138
github.com/google/go-cmp v0.5.8 // indirect
143139
github.com/google/go-querystring v1.0.0 // indirect
@@ -153,6 +149,7 @@ require (
153149
github.com/hashicorp/go-hclog v0.16.2 // indirect
154150
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
155151
github.com/hashicorp/go-msgpack v0.5.5 // indirect
152+
github.com/hashicorp/go-multierror v1.1.1 // indirect
156153
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
157154
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
158155
github.com/hashicorp/golang-lru v0.5.4 // indirect
@@ -218,6 +215,7 @@ require (
218215
github.com/spf13/pflag v1.0.5 // indirect
219216
github.com/stretchr/objx v0.4.0 // indirect
220217
github.com/tencentyun/cos-go-sdk-v5 v0.7.34 // indirect
218+
github.com/thanos-io/objstore v0.0.0-20220324141029-c4f11442aa33 // indirect
221219
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
222220
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
223221
github.com/valyala/bytebufferpool v1.0.0 // indirect

go.sum

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,6 @@ github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8l
427427
github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9/go.mod h1:D6ICZm05D9VN1n/8iOtBxLpXtoGp6HDFUJ1RNVieOSE=
428428
github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k=
429429
github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE=
430-
github.com/dgraph-io/badger/v3 v3.2103.2 h1:dpyM5eCJAtQCBcMCZcT4UBZchuTJgCywerHHgmxfxM8=
431-
github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M=
432430
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
433431
github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI=
434432
github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug=
@@ -768,7 +766,6 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z
768766
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
769767
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
770768
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
771-
github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
772769
github.com/google/flatbuffers v2.0.5+incompatible h1:ANsW0idDAXIY+mNHzIHxWRfabV2x5LUEEIIWcwsYgB8=
773770
github.com/google/flatbuffers v2.0.5+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
774771
github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=
@@ -985,7 +982,6 @@ github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j
985982
github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
986983
github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
987984
github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
988-
github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
989985
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
990986
github.com/klauspost/compress v1.14.2/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
991987
github.com/klauspost/compress v1.15.6 h1:6D9PcO8QWu0JyaQ2zUMmu16T1T+zjjEpP91guRsvDfY=
@@ -1543,7 +1539,6 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
15431539
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
15441540
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
15451541
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
1546-
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
15471542
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
15481543
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
15491544
go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=

pkg/firedb/create_test.go

Lines changed: 0 additions & 154 deletions
This file was deleted.

pkg/firedb/functions.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package firedb
2+
3+
import (
4+
profilev1 "github.com/grafana/fire/pkg/gen/google/v1"
5+
)
6+
7+
type functionsKey struct {
8+
Name int64
9+
SystemName int64
10+
Filename int64
11+
StartLine int64
12+
}
13+
14+
type functionsHelper struct {
15+
}
16+
17+
func (*functionsHelper) key(f *profilev1.Function) functionsKey {
18+
return functionsKey{
19+
Name: f.Name,
20+
SystemName: f.SystemName,
21+
Filename: f.Filename,
22+
StartLine: f.StartLine,
23+
}
24+
}
25+
26+
func (*functionsHelper) addToRewriter(r *rewriter, elemRewriter idConversionTable) {
27+
r.functions = elemRewriter
28+
}
29+
30+
func (*functionsHelper) rewrite(r *rewriter, f *profilev1.Function) error {
31+
r.strings.rewrite(&f.Filename)
32+
r.strings.rewrite(&f.Name)
33+
r.strings.rewrite(&f.SystemName)
34+
return nil
35+
}

0 commit comments

Comments
 (0)