Ver código fonte

go fmt ./...

Vadim Markovtsev 7 anos atrás
pai
commit
31d564a3e9
3 arquivos alterados com 7 adições e 7 exclusões
  1. 1 1
      diff_refiner.go
  2. 3 3
      diff_refiner_test.go
  3. 3 3
      diff_test.go

+ 1 - 1
diff_refiner.go

@@ -81,7 +81,7 @@ func (ref *FileDiffRefiner) Consume(deps map[string]interface{}) (map[string]int
 		visitEachNode(uastChange.After, func(node *uast.Node) {
 			if node.StartPosition != nil && node.EndPosition != nil {
 				for l := node.StartPosition.Line; l <= node.EndPosition.Line; l++ {
-					nodes := line2node[l-1]  // line starts with 1
+					nodes := line2node[l-1] // line starts with 1
 					if nodes == nil {
 						nodes = []*uast.Node{}
 					}

+ 3 - 3
diff_refiner_test.go

@@ -6,11 +6,11 @@ import (
 	"testing"
 	"unicode/utf8"
 
-	"github.com/sergi/go-diff/diffmatchpatch"
 	"github.com/gogo/protobuf/proto"
+	"github.com/sergi/go-diff/diffmatchpatch"
 	"github.com/stretchr/testify/assert"
-	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/bblfsh/sdk.v1/uast"
+	"gopkg.in/src-d/go-git.v4/plumbing/object"
 )
 
 func fixtureFileDiffRefiner() *FileDiffRefiner {
@@ -76,7 +76,7 @@ func TestFileDiffRefinerConsume(t *testing.T) {
 	uastChanges[0] = UASTChange{
 		Change: &object.Change{
 			From: object.ChangeEntry{Name: fileName},
-			To: object.ChangeEntry{Name: fileName}},
+			To:   object.ChangeEntry{Name: fileName}},
 		Before: loadUast("uast1.pb"), After: loadUast("uast2.pb"),
 	}
 	fd := fixtureFileDiffRefiner()

+ 3 - 3
diff_test.go

@@ -233,13 +233,13 @@ notifications:
 }
 
 func TestFileDiffDarkMagic(t *testing.T) {
-  fd := fixtureFileDiff()
+	fd := fixtureFileDiff()
 	deps := map[string]interface{}{}
 	cache := map[plumbing.Hash]*object.Blob{}
 	hash := plumbing.NewHash("448eb3f312849b0ca766063d06b09481c987b309")
-	cache[hash], _ = testRepository.BlobObject(hash)  // 1.java
+	cache[hash], _ = testRepository.BlobObject(hash) // 1.java
 	hash = plumbing.NewHash("3312c92f3e8bdfbbdb30bccb6acd1b85bc338dfc")
-	cache[hash], _ = testRepository.BlobObject(hash)  // 2.java
+	cache[hash], _ = testRepository.BlobObject(hash) // 2.java
 	deps[DependencyBlobCache] = cache
 	changes := make(object.Changes, 1)
 	treeFrom, _ := testRepository.TreeObject(plumbing.NewHash(