My Lemmy Oracle
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Golang@programming.dev · 2 months ago

You don't need testify/assert (Golang)

antonz.org

external-link
message-square
4
fedilink
-2
external-link

You don't need testify/assert (Golang)

antonz.org

cm0002@lemmy.world to Golang@programming.dev · 2 months ago
message-square
4
fedilink
Expressive tests without testify/assert
antonz.org
external-link
Equal, Err and True are quite enough.
  • 𝕽𝖚𝖆𝖎𝖉𝖍𝖗𝖎𝖌𝖍@midwest.social
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    2 months 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.

Golang@programming.dev

golang@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

This is a community dedicated to the go programming language.

Useful Links:

  • Go Website
  • Effective Go
  • Go by Example
  • How to Start a Go Project

Rules:

  • Posts must be relevant to Go
  • No NSFW content
  • No hate speech, bigotry, etc
  • Try to keep discussions on topic
  • No spam of tools/companies/advertisements
  • It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 23 users / week
  • 60 users / month
  • 247 users / 6 months
  • 1 local subscriber
  • 2.54K subscribers
  • 233 Posts
  • 264 Comments
  • Modlog
  • mods:
  • Ategon@programming.dev
  • RandomDevOpsDude@programming.dev
  • austin@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org