cleaning

Michael Muré created

Change summary

bug/operations/create_test.go |  2 +-
bug/operations/set_title.go   |  2 +-
bug/person.go                 | 19 ++-----------------
tests/bug_test.go             |  2 +-
4 files changed, 5 insertions(+), 20 deletions(-)

Detailed changes

bug/operations/create_test.go 🔗

@@ -26,6 +26,6 @@ func TestCreate(t *testing.T) {
 	}
 
 	if !reflect.DeepEqual(snapshot, expected) {
-		t.Fatalf("%s different than %s", snapshot, expected)
+		t.Fatalf("%v different than %v", snapshot, expected)
 	}
 }

bug/operations/set_title.go 🔗

@@ -6,7 +6,7 @@ var _ bug.Operation = SetTitleOperation{}
 
 type SetTitleOperation struct {
 	bug.OpBase
-	Title string `json:"t"`
+	Title string
 }
 
 func NewSetTitleOp(title string) SetTitleOperation {

bug/person.go 🔗

@@ -1,15 +1,13 @@
 package bug
 
 import (
-	"encoding/json"
 	"errors"
 	"github.com/MichaelMure/git-bug/repository"
-	"github.com/MichaelMure/git-bug/util"
 )
 
 type Person struct {
-	Name  string `json:"name"`
-	Email string `json:"email"`
+	Name  string
+	Email string
 }
 
 // GetUser will query the repository for user detail and build the corresponding Person
@@ -32,16 +30,3 @@ func GetUser(repo repository.Repo) (Person, error) {
 
 	return Person{Name: name, Email: email}, nil
 }
-
-// Store will convert the Person to JSON and store it in the internal git datastore
-// Return the git hash handle of the data
-func (person *Person) Store(repo repository.Repo) (util.Hash, error) {
-
-	data, err := json.Marshal(person)
-
-	if err != nil {
-		return "", err
-	}
-
-	return repo.StoreData(data)
-}

tests/bug_test.go 🔗

@@ -68,6 +68,6 @@ func TestBugSerialisation(t *testing.T) {
 	}
 
 	if !reflect.DeepEqual(bug1, bug2) {
-		t.Fatalf("%s different than %s", bug1, bug2)
+		t.Fatalf("%v different than %v", bug1, bug2)
 	}
 }