News for hackers. Stuff that matters.
Re:Monkey Patching in Golang (2015) by rodrigobrito on Friday February 28, 2020 @08:14AM (#22442523)
Read the license before use the library: https://github.com/bouk/monkey/blob/master/LICENSE.md Caution! This approach is very dangerous, and not thread safe.
Re:Monkey Patching in Golang (2015) by rob74 on Friday February 28, 2020 @08:31AM (#22442608)
"I took the above code and put it in an easy to use library" ... [but] "I do not give anyone permissions to use this tool for any purpose. Don't use it."

Sounds strange, until you consider that he only added the "license" 2 years later. I wonder how many questions from various people wanting to use the tool for various purposes he received during this time?

Re:Monkey Patching in Golang (2015) by bouk on Friday February 28, 2020 @08:56AM (#22442754)
People kept asking for a license so they could use it, so I added a license that clarifies that this is not a project that should be seriously used.
Re:Monkey Patching in Golang (2015) by jerf on Friday February 28, 2020 @11:24AM (#22443864)
That is a beautiful, if sort of minor, hack. "I need a license because I want to use this at work and they need me to have a license for all code we use." "Here's the license: 'No.'"

It's like the opposite of the WTFPL [1], the FYL.

[1]: https://en.wikipedia.org/wiki/WTFPL

Re:Monkey Patching in Golang (2015) by onionisafruit on Friday February 28, 2020 @09:24AM (#22442947)
I can imagine the type people looking to actually use this. They are using go for whatever reason but complain about it constantly because they want it to be Ruby on Rails.
Re:Monkey Patching in Golang (2015) by bouk on Friday February 28, 2020 @09:25AM (#22442958)
People really want to mock out dependencies in go, instead of architecting their application properly
Re:Monkey Patching in Golang (2015) by onionisafruit on Friday February 28, 2020 @09:36AM (#22443025)
I’m all over using gomock to test my packages in isolation. I’ll just continue to do that with generated mocks instead of trying to monkeypatch a language that isn’t intended for that.

I’m curious about your motivation for writing this. Did it start out as something legitimate and morphed into a joke when you wanted to see how far you can push it? Or were you taking the piss the whole time?

Re:Monkey Patching in Golang (2015) by bouk on Friday February 28, 2020 @09:41AM (#22443049)
Taking the piss 100%
Re:Monkey Patching in Golang (2015) by giancarlostoro on Friday February 28, 2020 @08:22AM (#22442567)
> I do not give anyone permissions to use this tool for any purpose. Don't use it.

At least "any purpose" should say anything other than personal testing or something. This is silly otherwise. On the other hand at least he's transparent about it.

Re:Monkey Patching in Golang (2015) by mcny on Friday February 28, 2020 @10:54AM (#22443581)
> This is silly otherwise.

There are many things for which we do not need permission though. I am OK with these words.

Re:Monkey Patching in Golang (2015) by bouk on Friday February 28, 2020 @09:12AM (#22442855)
The project is meant as one big joke, so yeah don't use it.
Re:Monkey Patching in Golang (2015) by takeda on Wednesday March 04, 2020 @05:13PM (#22488721)
Looks like someone made a MIT licensed version of it: https://github.com/undefinedlabs/go-mpatch
Re:Monkey Patching in Golang (2015) by saagarjha on Friday February 28, 2020 @08:23AM (#22442578)
It should be thread safe once the write completes, no?