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
Related to #16, if I omit the pass-by-reference:
func ( u User ) SetUsername ( uname string ) { // <--- * missing here u.username = username(uname) }
Then the error is yet again
$ go test --- FAIL: TestMethods (0.00s) panic: interface conversion: interface {} is user.username, not string [recovered] panic: interface conversion: interface {} is user.username, not string goroutine 5 [running]: testing.tRunner.func1(0xc4201240f0) /usr/lib/go-1.10/src/testing/testing.go:742 +0x29d panic(0x687ce0, 0xc420062880) /usr/lib/go-1.10/src/runtime/panic.go:502 +0x229 github.com/stretchr/testify/assert.diff(0x66f4c0, 0x70bd60, 0x66f4c0, 0xc420010c80, 0x0, 0x0) /home/goclass/go/src/github.com/stretchr/testify/assert/assertions.go:1352 +0x453 github.com/stretchr/testify/assert.Equal(0x70d260, 0xc4201240f0, 0x66f4c0, 0x70bd60, 0x66f4c0, 0xc420010c80, 0xc420059e48, 0x1, 0x1, 0xc420010c80) /home/goclass/go/src/github.com/stretchr/testify/assert/assertions.go:338 +0x26a github.com/stretchr/testify/assert.(*Assertions).Equal(0xc420047dc8, 0x66f4c0, 0x70bd60, 0x66f4c0, 0xc420010c80, 0xc420047e48, 0x1, 0x1, 0x40d9f301) /home/goclass/go/src/github.com/stretchr/testify/assert/assertion_forward.go:129 +0xca github.com/autarch/intro-to-go-class-exercises/7-basic-oo/user.TestMethods(0xc4201240f0) /home/goclass/go/src/github.com/autarch/intro-to-go-class-exercises/7-basic-oo/user/user_test.go:21 +0x48a testing.tRunner(0xc4201240f0, 0x6ec5e0) /usr/lib/go-1.10/src/testing/testing.go:777 +0xd0 created by testing.(*T).Run /usr/lib/go-1.10/src/testing/testing.go:824 +0x2e0 exit status 2 FAIL github.com/autarch/intro-to-go-class-exercises/7-basic-oo/user 0.008s
The text was updated successfully, but these errors were encountered:
Fixed in stretchr/testify#622
Hopefully this will get merged before the next time I do this class.
Sorry, something went wrong.
Fixed by updating the deps for the class exercises.
No branches or pull requests
Related to #16, if I omit the pass-by-reference:
Then the error is yet again
The text was updated successfully, but these errors were encountered: