We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to compare IDs of package github.com/graph-gophers/graphql-go. These IDs are actually just a type alias for strings:
// ID represents GraphQL's "ID" scalar type. A custom type may be used instead. type ID string
However if these IDs are not equal, require.Equal panics:
func TestResolver(t *testing.T) { require.Equal(t, graphql.ID("2015"), graphql.ID("1915")) }
=== RUN TestResolver --- FAIL: TestResolver (0.00s) panic: interface conversion: interface {} is graphql.ID, not string [recovered] panic: interface conversion: interface {} is graphql.ID, not string goroutine 148 [running]: testing.tRunner.func1(0xc4203ac1e0) /usr/local/go/src/testing/testing.go:742 +0x567 panic(0x1a60400, 0xc420280440) /usr/local/go/src/runtime/panic.go:502 +0x24a github.com/SpaceHeroGuide/wertungsheft/vendor/github.com/stretchr/testify/assert.diff(0x1a56c80, 0x1c484e0, 0x1a56c80, 0x1c484f0, 0x0, 0x0) /Users/matthias/Golang/src/github.com/SpaceHeroGuide/wertungsheft/vendor/github.com/stretchr/testify/assert/assertions.go:1352 +0x4ba github.com/SpaceHeroGuide/wertungsheft/vendor/github.com/stretchr/testify/assert.Equal(0x44a0188, 0xc4203ac1e0, 0x1a56c80, 0x1c484e0, 0x1a56c80, 0x1c484f0, 0x0, 0x0, 0x0, 0xc4203ac1e0) /Users/matthias/Golang/src/github.com/SpaceHeroGuide/wertungsheft/vendor/github.com/stretchr/testify/assert/assertions.go:338 +0x2f8 github.com/SpaceHeroGuide/wertungsheft/vendor/github.com/stretchr/testify/require.Equal(0x1c508e0, 0xc4203ac1e0, 0x1a56c80, 0x1c484e0, 0x1a56c80, 0x1c484f0, 0x0, 0x0, 0x0) /Users/matthias/Golang/src/github.com/SpaceHeroGuide/wertungsheft/vendor/github.com/stretchr/testify/require/require.go:157 +0xc0 github.com/SpaceHeroGuide/wertungsheft/vendor/github.com/stretchr/testify/require.(*Assertions).Equal(0xc42036ae68, 0x1a56c80, 0x1c484e0, 0x1a56c80, 0x1c484f0, 0x0, 0x0, 0x0) /Users/matthias/Golang/src/github.com/SpaceHeroGuide/wertungsheft/vendor/github.com/stretchr/testify/require/require_forward.go:130 +0xe3 github.com/SpaceHeroGuide/wertungsheft/pkg/api/tournament_test.TestResolver(0xc4203ac1e0) /Users/matthias/Golang/src/github.com/SpaceHeroGuide/wertungsheft/pkg/api/tournament/tournament_test.go:90 +0x163 testing.tRunner(0xc4203ac1e0, 0x1b6a7a0) /usr/local/go/src/testing/testing.go:777 +0x16e created by testing.(*T).Run /usr/local/go/src/testing/testing.go:824 +0x565 FAIL github.com/SpaceHeroGuide/wertungsheft/pkg/api/tournament 2.198s
If you change the IDs so they are equal, the panic does not occur.
The text was updated successfully, but these errors were encountered:
Duplicate or Same as #644.
Sorry, something went wrong.
Created a PR here which should solve the problem 😊
#661
No branches or pull requests
I'm trying to compare IDs of package github.com/graph-gophers/graphql-go. These IDs are actually just a type alias for strings:
However if these IDs are not equal, require.Equal panics:
If you change the IDs so they are equal, the panic does not occur.
The text was updated successfully, but these errors were encountered: