Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Loki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Loki
Commits
99f5b161
Commit
99f5b161
authored
6 years ago
by
RikiyaFujii
Committed by
Tom Wilkie
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix return value. (#134)
Signed-off-by:
RikiyaFujii
<
ridai22hanriku@gmail.com
>
parent
0d3815ed
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/logcli/query.go
+3
-6
3 additions, 6 deletions
cmd/logcli/query.go
with
3 additions
and
6 deletions
cmd/logcli/query.go
+
3
−
6
View file @
99f5b161
...
...
@@ -37,10 +37,7 @@ func doQuery() {
log
.
Fatalf
(
"Query failed: %+v"
,
err
)
}
cache
,
lss
,
err
:=
parseLabels
(
resp
)
if
err
!=
nil
{
log
.
Fatalf
(
"Failed parsing labels: %+v"
,
err
)
}
cache
,
lss
:=
parseLabels
(
resp
)
labelsCache
=
func
(
labels
string
)
labels
.
Labels
{
return
cache
[
labels
]
...
...
@@ -92,7 +89,7 @@ func mustParseLabels(labels string) labels.Labels {
return
ls
}
func
parseLabels
(
resp
*
logproto
.
QueryResponse
)
(
map
[
string
]
labels
.
Labels
,
[]
labels
.
Labels
,
error
)
{
func
parseLabels
(
resp
*
logproto
.
QueryResponse
)
(
map
[
string
]
labels
.
Labels
,
[]
labels
.
Labels
)
{
cache
:=
make
(
map
[
string
]
labels
.
Labels
,
len
(
resp
.
Streams
))
lss
:=
make
([]
labels
.
Labels
,
0
,
len
(
resp
.
Streams
))
for
_
,
stream
:=
range
resp
.
Streams
{
...
...
@@ -100,7 +97,7 @@ func parseLabels(resp *logproto.QueryResponse) (map[string]labels.Labels, []labe
cache
[
stream
.
Labels
]
=
ls
lss
=
append
(
lss
,
ls
)
}
return
cache
,
lss
,
nil
return
cache
,
lss
}
func
commonLabels
(
lss
[]
labels
.
Labels
)
labels
.
Labels
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment