Skip to content

Commit

Permalink
removing unnecessary utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
yazgazan committed Apr 26, 2017
1 parent f6cda0c commit e6ce16c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 55 deletions.
6 changes: 0 additions & 6 deletions diff/ignore.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ func Ignore() (Differ, error) {
return ignore{}, nil
}

func IsIgnore(d Differ) bool {
_, ok := d.(ignore)

return ok
}

func (t ignore) Diff() Type {
return Identical
}
Expand Down
18 changes: 0 additions & 18 deletions diff/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ func newMap(lhs, rhs interface{}) (mapDiff, error) {
}, nil
}

func IsMap(d Differ) bool {
_, ok := d.(mapDiff)

return ok
}

func mapTypesDiffer(lhs, rhs interface{}) (bool, error) {
if lhs == nil {
return true, ErrInvalidType{Value: lhs, For: "map"}
Expand Down Expand Up @@ -230,12 +224,6 @@ func getKeys(lhs, rhs reflect.Value) []reflect.Value {
return keys
}

func IsMapMissing(d Differ) bool {
_, ok := d.(mapMissing)

return ok
}

func (m mapMissing) Diff() Type {
return ContentDiffer
}
Expand All @@ -251,12 +239,6 @@ func (m mapMissing) StringIndent(key, prefix string, conf Output) string {
"\n+" + prefix + key
}

func IsMapExcess(d Differ) bool {
_, ok := d.(mapExcess)

return ok
}

func (e mapExcess) Diff() Type {
return ContentDiffer
}
Expand Down
6 changes: 0 additions & 6 deletions diff/scalar.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ type scalar struct {
rhs interface{}
}

func IsScalar(d Differ) bool {
_, ok := d.(scalar)

return ok
}

func (s scalar) Diff() Type {
lhsVal := reflect.ValueOf(s.lhs)
rhsVal := reflect.ValueOf(s.rhs)
Expand Down
18 changes: 0 additions & 18 deletions diff/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ func newSlice(lhs, rhs interface{}) (Differ, error) {
}, nil
}

func IsSlice(d Differ) bool {
_, ok := d.(slice)

return ok
}

func sliceTypesDiffer(lhs, rhs interface{}) (bool, error) {
if lhs == nil {
return true, ErrInvalidType{Value: lhs, For: "slice"}
Expand Down Expand Up @@ -165,12 +159,6 @@ func (s slice) Walk(path string, fn WalkFn) error {
return nil
}

func IsSliceMissing(d Differ) bool {
_, ok := d.(sliceMissing)

return ok
}

func (m sliceMissing) Diff() Type {
return ContentDiffer
}
Expand All @@ -190,12 +178,6 @@ func (e sliceExcess) Diff() Type {
return ContentDiffer
}

func IsSliceExcess(d Differ) bool {
_, ok := d.(sliceExcess)

return ok
}

func (e sliceExcess) Strings() []string {
return []string{
fmt.Sprintf("+ %T %v", e.value, e.value),
Expand Down
6 changes: 0 additions & 6 deletions diff/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ type types struct {
rhs interface{}
}

func IsTypes(d Differ) bool {
_, ok := d.(types)

return ok
}

func (t types) Diff() Type {
return TypesDiffer
}
Expand Down
2 changes: 1 addition & 1 deletion diff/walk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestWalkError(t *testing.T) {
}

_, err = Walk(d, func(_, diff Differ, _ string) (Differ, error) {
if IsScalar(diff) {
if _, ok := diff.(scalar); ok {
return nil, expectedErr
}

Expand Down

0 comments on commit e6ce16c

Please sign in to comment.