Comments (5)
@ash2k hi
but static analysis likely cannot catch all cases
I think these are very rare cases, because the linter works exactly the same way βΒ it analyzes the call stack.
But it looks as poor workaround for the open source library.
At the moment the Go team is going the static analysis way (go vet's testinggoroutine
check), and I'm not sure they'll check the stack rather than just remove the requirement for where these functions should be called.
Because when I was testing my linter, I noticed that many projects (especially the largest ones) use require
in goroutines and your proposal will be breaking change for them and looks like candidate for v2
tag.
Anyway sorry for offtop π
from testify.
@Antonboom Don't be sorry: this is totally on topic.
from testify.
No idea how this could be implemented (if ever that is a good idea in the first place).
from testify.
Covered by https://github.com/Antonboom/testifylint#go-require
from testify.
@dolmen Perhaps the check could be implemented by the assertion looking at the goroutine's stacktrace? This might be fragile as stacktrace is not an API so there should be a test for this.
@Antonboom That's cool but static analysis likely cannot catch all cases.
from testify.
Related Issues (20)
- unnecessary/incorrect log call in AssertExpectations HOT 2
- Data race when mock is called with refernce to same object as expectation HOT 1
- assert fails and expects to dereference a reference HOT 1
- Add GoLang 1.22 to CI Testing Matrix for Package Compatibility Verification HOT 2
- error while importing github.com/stretchr/testify/suite: read C:\Program Files\Go\src\math\huge_test.go: unexpected NUL in input HOT 1
- AnythingOfType is marked deprecated on pkgsite HOT 1
- .On().Return() doesn't enforce expectation for the returned value HOT 1
- v1.9.0 breaks float comparisons with EqualValues HOT 6
- mock: cleanup argument matching API HOT 7
- Integer overflow in time.Time comparison
- EqualExportedValues can compare two slices HOT 2
- Regexp accepts interface{} HOT 3
- Drop outdated/abandoned dependencies HOT 3
- Proposal: Must-like utility HOT 3
- Proposal: assert.NotElementsMatch() HOT 4
- assert: invalid memory address or nil pointer dereference for assert.Error on darwin/arm64 HOT 1
- mock: Diff is prone to data races
- call.Unset() panics when call := mockObj.On("Foo", mock.AnythingOfType("foo")) HOT 1
- Proposal: assert.NoFieldIsEmpty HOT 13
- Feature request: add BeforeSetupTest and AfterTearDownTest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testify.