Skip to content
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

don't copy mutex #1200

Closed
wants to merge 1 commit into from
Closed

don't copy mutex #1200

wants to merge 1 commit into from

Conversation

daniel-meyer-dme
Copy link

Summary

prevent govet: copylocks when referencing suite.Suite by using a pointer to the mutex

Changes

  • switch mu to a pointer

Motivation

fix govet complaints

Related issues

Closes #1199

@boyan-soubachov
Copy link
Collaborator

Fixed in latest PR, thank you :)

@drichelson
Copy link

@daniel-meyer-dme @boyan-soubachov It looks like this change did not make it into master. See my comment here: #1199 (comment)

May I request we re-open this PR and merge it?

@RajeshDasari
Copy link

I see that this change is still not in master, any reason for it ? @daniel-meyer-dme @boyan-soubachov

@SVilgelm
Copy link

@RajeshDasari
Copy link

@SVilgelm Thanks for the response. But we are importing from github.com/stretchr/testify in our local go files. any plans to port the changes ?

@RajeshDasari
Copy link

we are getting the below error with the above change .

suite.go:73: test panicked: runtime error: invalid memory address or nil pointer dereference
goroutine 19 [running]:
runtime/debug.Stack()
/usr/lib/golang/src/runtime/debug/stack.go:24 +0x65
github.com/stretchr/testify/suite.failOnPanic(0xc0001501a0)
/home/radasari/rpmbuild/BUILD/test/vendor/github.com/stretchr/testify/suite/suite.go:73 +0x3e
panic({0x83d600, 0xb9df60})
/usr/lib/golang/src/runtime/panic.go:838 +0x207
sync.(*RWMutex).Lock(0x0?)
/usr/lib/golang/src/sync/rwmutex.go:139 +0x1e
github.com/stretchr/testify/suite.(*Suite).SetT(0xc0000c09b0, 0xc0001501a0)
/home/radasari/rpmbuild/BUILD/test/vendor/github.com/stretchr/testify/suite/suite.go:39 +0x3f
github.com/stretchr/testify/suite.Run(0xc0001501a0, {0x941038, 0xc0000c09b0})
/home/radasari/rpmbuild/BUILD/test/vendor/github.com/stretchr/testify/suite/suite.go:96 +0x93
test/src/test/pkg/api.TestCheckUserPasswdSuite(0x0?)
/home/radasari/rpmbuild/BUILD/test/src/test/pkg/api/checkuserpasswd_test.go:163 +0x39
testing.tRunner(0xc0001501a0, 0x8d82d0)
/usr/lib/golang/src/testing/testing.go:1439 +0x102
created by testing.(*T).Run
/usr/lib/golang/src/testing/testing.go:1486 +0x35f
--- FAIL: TestJsonStrucTypeSuite (0.00s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release 1.7.2 causes go vet errors when embedding suite.Suite
5 participants