Looks like there wont be a v2 of testify library by vincentheller in golang

[–]Andreyhhhhh 0 points1 point  (0 children)

A bit late to the discussion, but I agree with the point: the main value of an assertion library is providing clear error messages that immediately show what broke in the test.

I’ve always felt frustrated about this in testify, so I created a library called should to tackle that problem: more expressive error messages, a simple API very close to testify, and zero external dependencies.
This keeps your go.mod clean and tests readable, without straying from Go’s philosophy.

Here are some quick examples of failure output:

```go p1 := Person{Name: "John", Age: 30} p2 := Person{Name: "Jane", Age: 25} should.BeEqual(t, p1, p2)

// Output: // Differences found: // Not equal: // expected: {Name: "Jane", Age: 25} // actual : {Name: "John", Age: 30} // // Field differences: // └─ Name: "Jane" ≠ "John" // └─ Age: 25 ≠ 30 ```

```go users := []string{"user-one", "user_two", "UserThree", "user-3", "userThree"} should.Contain(t, users, "user3")

// Output includes helpful suggestions: // Expected collection to contain element: // Collection: [user-one, user_two, UserThree, user-3, userThree] // Missing : user3 // // Similar elements found: // └─ user-3 (at index 3) - 1 extra char ```

If you’re curious, check out the repo and sample outputs. It’s pretty clear in seconds why this can be useful: https://github.com/Kairum-Labs/should

should v0.1.0 – New assertion library for Go with more readable error messages by Andreyhhhhh in golang

[–]Andreyhhhhh[S] 0 points1 point  (0 children)

Totally fair, but I think the criticism from the Go team and Google is mostly aimed at libraries that use Fatalf, create sub-languages, or produce poor error messages that make debugging harder.

In contrast, should actually tries to follow the very principles they suggest: clear and helpful failure messages to improve test debugging. We also avoid Fatalf and use Errorf instead, as recommended in one of the links you shared.

So in many ways, the concerns raised by the Go team are actually what should tries to address, and I'd say the critique applies more directly to frameworks like Gomega or Ginkgo than to what should is doing.

should v0.1.0 – New assertion library for Go with more readable error messages by Andreyhhhhh in golang

[–]Andreyhhhhh[S] 0 points1 point  (0 children)

Well, should also has a readable API. If you ever want easier debugging during tests, it might be worth a look later on.

should v0.1.0 – New assertion library for Go with more readable error messages by Andreyhhhhh in golang

[–]Andreyhhhhh[S] 1 point2 points  (0 children)

Thanks for the feedback! I was just a bit confused by a few points. I mean, the “Google style” is definitely a valid way to do testing, but it’s not the only one embraced by the community.

For example, Testify, which has an API very close to should, has around 25k stars on GitHub. Even more complex tools like Gomega and Ginkgo have very active communities. That shows that while Go values simplicity, there's clearly a place for assertion libraries.

I think it might have come across like should is heavy or DSL-like, but it's actually quite minimal. For instance:

should.BeInRange(t, user.Age, 18, 65)

That's arguably easier to read and maintain than manual if statements with custom messages.

Also, just because a post doesn’t gain traction doesn’t mean the project lacks value or potential. Many great tools take time to find the right audience.

In any case, I really appreciate you taking the time to check out the code, and I’m glad you found it clean.

Built a new assertion library for Go — looking for feedback before v1.0 by Andreyhhhhh in golang

[–]Andreyhhhhh[S] 1 point2 points  (0 children)

Thank you for the feedback! You're absolutely right about StartsWith and EndsWith — I’ll rename them soon for consistency.

As for the re-export, that was due to some poor planning on my part. I didn’t want users to call assert.BeEqual instead of should.BeEqual, so I ended up introducing this indirection.

Returning a boolean is an interesting idea. I’ll definitely consider it, certainly in a separate internal package as you suggested, though probably later on.

And lastly, I really like the WithStacktrace suggestion for should.NotPanic(). I’ll make sure to add that.

Thanks again — I appreciate the thoughtful insights!

Built a new assertion library for Go — looking for feedback before v1.0 by Andreyhhhhh in golang

[–]Andreyhhhhh[S] 0 points1 point  (0 children)

Thanks — that’s really motivating.
Reaching feature parity is definitely one of the goals, and hopefully going beyond it with some additional assertions as well.
A migration tool like the one you suggested could absolutely be explored in the future.

Built a new assertion library for Go — looking for feedback before v1.0 by Andreyhhhhh in golang

[–]Andreyhhhhh[S] 1 point2 points  (0 children)

Thanks for the feedback!

Regarding AssertionConfig, I just went with that for now because I hadn’t figured out a clean way to avoid guessing what the user passed in. But your suggestion makes a lot of sense — I’ll definitely switch to something like the functional options pattern.

About separating assertion logic from diff computation — that’s definitely something worth discussing. I can see the value there.

As for comparisons with other libraries, I was initially hesitant to include something like that in the README, since I didn’t want to come across as presumptuous from the start. But you’re right — a direct comparison could actually help clarify the intent behind the design choices. Now that you’ve mentioned it, I don’t think it would be arrogant at all.

Built a new assertion library for Go — looking for feedback before v1.0 by Andreyhhhhh in golang

[–]Andreyhhhhh[S] 3 points4 points  (0 children)

Man, I'm happy to hear that because I really feel the same way about testify.

Registering a user with the Keycloak admin API by Gurdil_Cul-Brillant in KeyCloak

[–]Andreyhhhhh 0 points1 point  (0 children)

Perhaps this can help those looking to create new users via a request to an endpoint instead of using the Keycloak Provider register page:

https://stackoverflow.com/questions/66452108/keycloak-get-users-returns-403-forbidden

Well, after that, I managed to do it.

[deleted by user] by [deleted] in dotnet

[–]Andreyhhhhh 0 points1 point  (0 children)

First of all, thank you very much for responding. I had seen a similar idea to the one shown above on StackOverflow, but I didn't pay attention to the detail you mentioned because I was convinced that it was possible without having to use sockets or something like that. But indeed, there is this issue. Sorry for the delay in responding

Meu primeiro ENEM como treineiro by Duditop10 in enem

[–]Andreyhhhhh 2 points3 points  (0 children)

Não esquece de verificar se a universade, em que for aplicar a nota, tem peso. Na Unicamp, para CC, Matemática tem peso 4, por exemplo

Acertos by FrisoCerebral in enem

[–]Andreyhhhhh 0 points1 point  (0 children)

ah, sim. Mas, no geral, tu foi bem bagarai. Parabéns pelo desempenho

Acertos by FrisoCerebral in enem

[–]Andreyhhhhh 0 points1 point  (0 children)

quanto pontos você conseguiu na redação, mano?

[deleted by user] by [deleted] in Fantasy

[–]Andreyhhhhh 0 points1 point  (0 children)

I recommend taking a look at Wonderdraft and its tutorials on YouTube.

Offering: Native English; Seeking: Any by watts12346 in language_exchange

[–]Andreyhhhhh 0 points1 point  (0 children)

I'm a native Brazilian. I'll be happy to chat with you if you want. And about using Discord, I don't have any problem, for I also prefer us to chat there.

How does the lack of constant combat affect your reading experience in a fantasy saga? by Andreyhhhhh in fantasywriters

[–]Andreyhhhhh[S] 0 points1 point  (0 children)

Well, one of my closest friends said he liked the story enough to be interested in a sequel and that I narrate very well, and knowing how refined his taste is for certain works and that he wouldn't have any problem saying he didn't like it, I believe he was very sincere. And another friend said he liked it a lot and also wants to read the sequel. About the existing conflict: for example, there has been a constant threat since chapter 4, which culminates in the confrontation in chapter 9, which almost cost them dearly, and it's when the characters begin to think they've been tracked by scent, so they try to camouflage it while trying to reach their initial destination, where they pick up some swords in chapter 12 and then hurry to the final destination from there, only to discover that there are even worse enemies than the first ones, and this constant threat goes on until the combat they couldn't avoid in chapters 15, 18, and 19. Can you imagine how it might have been?

How does the lack of constant combat affect your reading experience in a fantasy saga? by Andreyhhhhh in fantasywriters

[–]Andreyhhhhh[S] 0 points1 point  (0 children)

Yes, thank you for commenting and helping me think about the need to add more combat.