Skip to content

Commit

Permalink
chore: fix warning (#318)
Browse files Browse the repository at this point in the history
Co-authored-by: Anqi <[email protected]>
  • Loading branch information
haoxins and Nicole00 authored Feb 27, 2024
1 parent 9bfafce commit 5135309
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions result_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ func (relationship Relationship) String() string {
dst = ValueWrapper{edge.Src, relationship.timezoneInfo}.String()
}
return fmt.Sprintf(`[:%s %s->%s @%d {%s}]`,
string(edge.Name), src, dst, edge.Ranking, fmt.Sprintf("%s", strings.Join(kvStr, ", ")))
string(edge.Name), src, dst, edge.Ranking, strings.Join(kvStr, ", "))
}

func (r1 Relationship) IsEqualTo(r2 *Relationship) bool {
Expand Down Expand Up @@ -814,7 +814,7 @@ func (pathWrap *PathWrapper) String() string {
dirChar1,
string(step.Name),
step.Ranking,
fmt.Sprintf("%s", strings.Join(kvStr, ", ")),
strings.Join(kvStr, ", "),
dirChar2,
ValueWrapper{&nebula.Value{VVal: step.Dst}, pathWrap.timezoneInfo}.String())
}
Expand Down Expand Up @@ -1379,7 +1379,7 @@ func MakeProfilingData(planNodeDesc *graph.PlanNodeDescription, isTckFmt bool) s
}
var buffer bytes.Buffer
json.Indent(&buffer, []byte(allProfiles), "", " ")
return string(buffer.Bytes())
return buffer.String()
}

// generate operator info for Row format.
Expand Down
4 changes: 2 additions & 2 deletions result_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,10 @@ func TestResultSet(t *testing.T) {
if err != nil {
t.Fatalf(err.Error())
}
temp, err := record.GetValueByIndex(0)
temp, _ := record.GetValueByIndex(0)
_, err = temp.AsNode()
assert.EqualError(t, err, "failed to convert value int to Node, value is not an vertex")
temp, err = record.GetValueByColName("col2")
_, err = record.GetValueByColName("col2")
assert.EqualError(t, err, "failed to get values, given column name 'col2' does not exist")
val, _ := record.GetValueByColName("col2_vertex")
node, _ := val.AsNode()
Expand Down
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func value2Nvalue(any interface{}) (value *nebula.Value, err error) {
value.SetGgVal(&v)
} else {
// unsupported other Value type, use this function carefully
err = fmt.Errorf("Only support convert boolean/float/int/string/map/list to nebula.Value but %T", any)
err = fmt.Errorf("only support convert boolean/float/int/string/map/list to nebula.Value but %T", any)
}
return
}
2 changes: 1 addition & 1 deletion session_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func (pool *SessionPool) ExecuteAndCheck(q string) (*ResultSet, error) {
errCode := rs.GetErrorCode()
if errCode != ErrorCode_SUCCEEDED {
errMsg := rs.GetErrorMsg()
return nil, fmt.Errorf("Fail to execute query. %s", errMsg)
return nil, fmt.Errorf("fail to execute query. %s", errMsg)
}

return rs, nil
Expand Down

0 comments on commit 5135309

Please sign in to comment.