▲ -2 ▼ You don't need testify/assert (Golang) (antonz.org) submitted 1 year ago by cm0002@lemmy.world to c/golang@programming.dev 4 comments fedilink hide all child comments
[–] MrTrono@lemmy.world 6 points 1 year ago (3 children) We don't need testify... proceeds to write testify permalink fedilink source hideshow 3 child comments replies: [–] sxan@midwest.social -1 points 1 year ago (2 children) For many cases, writing assert is both trivial and effective, and prevents importing yet another fairly large dependency. A little copying is better than a little dependency. Rob Pike permalink fedilink source parent hideshow 2 child comments replies: [–] MrTrono@lemmy.world 1 point 1 year ago (1 child) it is a test dependency wouldn't go tree shaking make any size concern moot. I'm not agreeing that you do or don't need testify, but find the argument against testify that is presented here incredibly weak. Ultimately if you're wasting any time thinking about an asset library you're doing it wrong. permalink fedilink source parent hideshow 1 child comment replies: [–] sxan@midwest.social 0 points 1 year ago It's not a dependency, though. I mean, it could be, but you can just ssd easily rewrite or copy/paste; his repos is basically a single for with a half dozen functions. It's a hundred LOC, or something. Copy the file, change the package. A little copying. I usually just re-implement the asserts as I need them, but copying this one for over into your project introduces no dependencies. If you import testify, you now have dependencies on testify github.com/davecgh/go-spew github.com/pmezard/go-difflib github.com/stretchr/objx gopkg.in/yaml.v3 because that's what testify imports. It's not the same, at all. permalink fedilink source parent
[–] sxan@midwest.social -1 points 1 year ago (2 children) For many cases, writing assert is both trivial and effective, and prevents importing yet another fairly large dependency. A little copying is better than a little dependency. Rob Pike permalink fedilink source parent hideshow 2 child comments replies: [–] MrTrono@lemmy.world 1 point 1 year ago (1 child) it is a test dependency wouldn't go tree shaking make any size concern moot. I'm not agreeing that you do or don't need testify, but find the argument against testify that is presented here incredibly weak. Ultimately if you're wasting any time thinking about an asset library you're doing it wrong. permalink fedilink source parent hideshow 1 child comment replies: [–] sxan@midwest.social 0 points 1 year ago It's not a dependency, though. I mean, it could be, but you can just ssd easily rewrite or copy/paste; his repos is basically a single for with a half dozen functions. It's a hundred LOC, or something. Copy the file, change the package. A little copying. I usually just re-implement the asserts as I need them, but copying this one for over into your project introduces no dependencies. If you import testify, you now have dependencies on testify github.com/davecgh/go-spew github.com/pmezard/go-difflib github.com/stretchr/objx gopkg.in/yaml.v3 because that's what testify imports. It's not the same, at all. permalink fedilink source parent
[–] MrTrono@lemmy.world 1 point 1 year ago (1 child) it is a test dependency wouldn't go tree shaking make any size concern moot. I'm not agreeing that you do or don't need testify, but find the argument against testify that is presented here incredibly weak. Ultimately if you're wasting any time thinking about an asset library you're doing it wrong. permalink fedilink source parent hideshow 1 child comment replies: [–] sxan@midwest.social 0 points 1 year ago It's not a dependency, though. I mean, it could be, but you can just ssd easily rewrite or copy/paste; his repos is basically a single for with a half dozen functions. It's a hundred LOC, or something. Copy the file, change the package. A little copying. I usually just re-implement the asserts as I need them, but copying this one for over into your project introduces no dependencies. If you import testify, you now have dependencies on testify github.com/davecgh/go-spew github.com/pmezard/go-difflib github.com/stretchr/objx gopkg.in/yaml.v3 because that's what testify imports. It's not the same, at all. permalink fedilink source parent
[–] sxan@midwest.social 0 points 1 year ago It's not a dependency, though. I mean, it could be, but you can just ssd easily rewrite or copy/paste; his repos is basically a single for with a half dozen functions. It's a hundred LOC, or something. Copy the file, change the package. A little copying. I usually just re-implement the asserts as I need them, but copying this one for over into your project introduces no dependencies. If you import testify, you now have dependencies on testify github.com/davecgh/go-spew github.com/pmezard/go-difflib github.com/stretchr/objx gopkg.in/yaml.v3 because that's what testify imports. It's not the same, at all. permalink fedilink source parent
all 4 comments