Optimize some wrong usage and spelling
Signed-off-by: wgliang <liangcszzu@163.com>
This commit is contained in:
@@ -231,7 +231,7 @@ func (b *BasicDiff) Basic(lines []*JSONLine) []*BasicBlock {
|
||||
// in the JSON document to a top level key.
|
||||
//
|
||||
// In order to produce distinct "blocks" when rendering the basic diff,
|
||||
// we need a way to distinguish between differnt sections of data.
|
||||
// we need a way to distinguish between different sections of data.
|
||||
// To do this, we consider the value(s) of each top-level JSON key to
|
||||
// represent a distinct block for Grafana's JSON data structure, so
|
||||
// we perform this check to see if we've entered a new "block". If we
|
||||
|
||||
@@ -302,16 +302,16 @@ func (f *JSONFormatter) processItem(value interface{}, deltas []diff.Delta, posi
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *JSONFormatter) searchDeltas(deltas []diff.Delta, postion diff.Position) (results []diff.Delta) {
|
||||
func (f *JSONFormatter) searchDeltas(deltas []diff.Delta, position diff.Position) (results []diff.Delta) {
|
||||
results = make([]diff.Delta, 0)
|
||||
for _, delta := range deltas {
|
||||
switch delta.(type) {
|
||||
case diff.PostDelta:
|
||||
if delta.(diff.PostDelta).PostPosition() == postion {
|
||||
if delta.(diff.PostDelta).PostPosition() == position {
|
||||
results = append(results, delta)
|
||||
}
|
||||
case diff.PreDelta:
|
||||
if delta.(diff.PreDelta).PrePosition() == postion {
|
||||
if delta.(diff.PreDelta).PrePosition() == position {
|
||||
results = append(results, delta)
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user