Comments (6)
P.S: Just out of curiosity, why is each test case wrapped into separate blocks? I'd probably place them into individual
t.Run
s instead and give more context via the description. It's probably just a question of preference, but I'm curios anyway
I copied and modified the existing TestMustX
code. There is no other intention.
from lo.
How about MustOK(Parse(""))
?
from lo.
MustOK
is good!
from lo.
No need, just allow any
instead of error
. You throw away compile time type matching for runtime assertion. It's not a problem because people who will use Must() expect their code to panic
at this point anyway.
from lo.
No need, just allow
any
instead oferror
. You throw away compile time type matching for runtime assertion. It's not a problem because people who will use Must() expect their code topanic
at this point anyway.
I didn't think that far. Check out my PR. Must*
panics when err
is error
or false
. I deleted condition err != nil
. Is it okay to ignore cases that err
is neither error
nor bool
?
from lo.
Your PR looks good :) thank your for your support on this 💯
P.S: Just out of curiosity, why is each test case wrapped into separate blocks? I'd probably place them into individual t.Run
s instead and give more context via the description. It's probably just a question of preference, but I'm curios anyway
from lo.
Related Issues (20)
- Is there any function like ObjectUtils#defaultIfNull ? HOT 2
- Proposal: lo.ClonePtr HOT 1
- Add Same function HOT 1
- proposal: get child array instead of source array in UniqBy
- ContainsBy for map HOT 2
- feat: add chain like js lodash flow HOT 1
- Proposal: Add throttle HOT 1
- Proposal: Parallel Uniq and Find
- Porposal: provide functions without index such as Map HOT 2
- The `lo.If'result` executed when `lo.If'condition` is false. HOT 4
- Does this repo still maintained? HOT 2
- lo.Associate()with nil slice returns non-nil map
- New func to add error to response
- IntersectBy,DifferenceBy,UnionBy for slice HOT 2
- Why is there no fuction for calculating the mean, such as mean or meanby?
- Add counterpart to ToSlicePtr: FromSlicePtr
- Is there any plan to add support for python's itertools module?
- Proposal: lo.OrElse() HOT 2
- tree shaking / dead code elimination HOT 2
- Add lo.MapByPtr HOT 3
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 lo.