Skip to content

drop google/go-cmp dependency #314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"unicode"
"unicode/utf8"

"github.com/google/go-cmp/cmp"
"golang.org/x/tools/go/ast/astutil"

"mvdan.cc/gofumpt/internal/govendor/go/format"
Expand Down Expand Up @@ -1037,8 +1036,7 @@ func (f *fumpter) shouldMergeAdjacentFields(f1, f2 *ast.Field) bool {
}

// Only merge if the types are equal.
opt := cmp.Comparer(func(x, y token.Pos) bool { return true })
return cmp.Equal(f1.Type, f2.Type, opt)
return reflect.TypeOf(f1.Type) == reflect.TypeOf(f2.Type)
}

var posType = reflect.TypeOf(token.NoPos)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.22

require (
github.com/go-quicktest/qt v1.101.0
github.com/google/go-cmp v0.6.0
github.com/rogpeppe/go-internal v1.12.0
golang.org/x/mod v0.14.0
golang.org/x/sync v0.6.0
Expand All @@ -13,6 +12,7 @@ require (
)

require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
)