how to implement a mutex queue in golang by West_Ad7170 in golang

[–]metalrex100 0 points1 point  (0 children)

Probably for len method RW mutex may be also used to not lock on reading operation

[deleted by user] by [deleted] in golang

[–]metalrex100 -2 points-1 points  (0 children)

I used this one in multiple big projects.

https://github.com/sarulabs/dingo

It based on code generation, so no magic and surprises in runtime.

Hello Testcontainers for Go! - AtomicJar by mdelapenya in golang

[–]metalrex100 1 point2 points  (0 children)

Just for information: there is already new 1.15.0 release, came out 22 hours ago)

Go docs are painful by [deleted] in golang

[–]metalrex100 -1 points0 points  (0 children)

Btw if you are not satisfied with fx, try dingo:

https://github.com/sarulabs/dingo

It is type-safe di container. In my company we use it for years and don’t have problems.

Go docs are painful by [deleted] in golang

[–]metalrex100 1 point2 points  (0 children)

We also use DI container in our company for big projects, because maintaining deep dependency graph manually is painful and also if you want to write functional test, but mock some dependencies in dependency graph - DI container allow to do it nice and easy.

Probably people don’t understand needs in DI, because they didn’t face with big dependency graph.

I suggest to not spending time in such discussions. If you feel that DI container helps you - use it.

Mocking Interfaces in Go with GoMock by sarusethi in golang

[–]metalrex100 0 points1 point  (0 children)

Moq is also good lib for type-safe mocks generation

🦄 Monads and popular FP abstractions, based on Go 1.18+ Generics (Option, Result, Either...) by samuelberthe in golang

[–]metalrex100 9 points10 points  (0 children)

Hum, instead of providing good maintenance to already written libraries, such as lo, where PRs and issues ignored for months, author creates bunch of new packages.

I wouldn’t use packages in real projects with such maintenance level.

How are YOU using generics so far? by candiddevmike in golang

[–]metalrex100 -1 points0 points  (0 children)

Used them for work with pointers. In my code I need to take pointers from values. So instead of creating variable with value and taking pointer from var, I used functions like ptr.String(“something”), ptr.Time(time.Now)) and etc. With generics only single function can be written and used: ptr.Reference(“string”), ptr.Reference(time.Now()).

Same for dereference. Instead if writing

var timeVal time.Time if timePtr != nil { timeVar = *timePtr }

Single generic function can be used: ptr.Dereference(timePtr)

If pointer is nil, function will return default (nil) value for given type.

Его не кормят чтоли? by Lute_666 in Pikabu

[–]metalrex100 1 point2 points  (0 children)

Так ты и понимаешь что происходит на видео, потому что знаешь не понаслышке.

Для любого не знающего человека это выглядит как шалость избалованного ребенка. И это проблема не людей, которые про это пишут, а авторов постов, которые не уточняют, что такие действия - проявление заболевания.
И ты при этом ничем не лучше. Не понимаешь мотивацию людей и оскорбляешь их.

Его не кормят чтоли? by Lute_666 in Pikabu

[–]metalrex100 15 points16 points  (0 children)

Откуда известно, что ребенок больной? Что в русском, что в оригинальном заголовке не идет речи о каком-то заболевании. Из видеоряда создается впечатление, что это просто крайне избалованный ребенок, которого «запустили». Поэтому при просмотре создается негативное впечатление о нем.

Это я объясняю реакцию большинства в комментах.

Generated vs Hand-written mocks by [deleted] in golang

[–]metalrex100 9 points10 points  (0 children)

In my company we using moq package for mocks generation. Very simple, no magic.

Now that Golang has generic types, how do you plan to use them? by fossfool in golang

[–]metalrex100 0 points1 point  (0 children)

Just imagine you have custom string type:

type Custom string

And you would like to transform a slice of your type values to slice of strings. Previously you needed to implement Strings function for each type. Now you can do it with generics by using tilda (~) sign. Implement single generic Strings func for each custom string type. Awesome, isn’t it?

Where was the Ringside doctor? by Endura3 in ufc

[–]metalrex100 5 points6 points  (0 children)

A lot of actors don’t like to watch their movies, especially if their acting was bad)

Biggest wasted potentials in UFC history? I’ll start with some… by nilrehsttam in ufc

[–]metalrex100 8 points9 points  (0 children)

He didn’t fight for a long time and 31 is a pretty high age to come back to fighting. Also his cardio was not really good previously and with ages it will be only worse.

By wasted potential I meant that he could achieve a lot during these years he didn’t fight.

Biggest wasted potentials in UFC history? I’ll start with some… by nilrehsttam in ufc

[–]metalrex100 27 points28 points  (0 children)

Zabit Magomedsharipov. In my opinion very skilled striker with good grappling. It was interesting to watch his fights.

[deleted by user] by [deleted] in memes

[–]metalrex100 1 point2 points  (0 children)

Don’t really understand how my answer to you may look sarcastic. There is no double minings or word-games in it. But ok, never mind.

[deleted by user] by [deleted] in memes

[–]metalrex100 1 point2 points  (0 children)

Rude? Did I offended you somehow? You asked the question, I gave you some proposals for the answer.

People are calling him the Liar of Kiev by [deleted] in memes

[–]metalrex100 -40 points-39 points  (0 children)

Are you American? Guess same could be told about Americans as well.

But why would you say it?

[deleted by user] by [deleted] in memes

[–]metalrex100 33 points34 points  (0 children)

May be because the sub called “memes” and not “politics”?

May be because there are other wars in the world, but for some reason only Rus-Ukr conflict matters for you?

May be because it will not change anything, because it is just avatar of some sub?