All Projects → cristaloleg → sabotage

cristaloleg / sabotage

Licence: BSD-3-Clause license
Collection of dirty hacks in Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to sabotage

sane patch
Making monkey patches sane again
Stars: ✭ 63 (-1.56%)
Mutual labels:  monkey-patching
flake8-putty
Flake8 plugin to control reporting per file and line
Stars: ✭ 38 (-40.62%)
Mutual labels:  monkey-patching
Harmony
A library for patching, replacing and decorating .NET and Mono methods during runtime
Stars: ✭ 2,885 (+4407.81%)
Mutual labels:  monkey-patching
Ui7kit
Backport flat-style UIKit from iOS7 to iOS5+
Stars: ✭ 1,682 (+2528.13%)
Mutual labels:  monkey-patching
Rewire
Easy monkey-patching for node.js unit tests
Stars: ✭ 2,940 (+4493.75%)
Mutual labels:  monkey-patching
bana
Set of extensions for Autodesk Maya's Python API.
Stars: ✭ 32 (-50%)
Mutual labels:  monkey-patching
ride
Simple and beautiful monkey-patching library for JavaScript.
Stars: ✭ 24 (-62.5%)
Mutual labels:  monkey-patching
rearmed rails
A collection of helpful methods and monkey patches for Rails
Stars: ✭ 34 (-46.87%)
Mutual labels:  monkey-patching
PerformanceTypes
A collection of low (or zero) allocation algorithms for .NET
Stars: ✭ 15 (-76.56%)
Mutual labels:  unsafe
RazorSharp
Low-level utilities and tools for working with the CLR and memory.
Stars: ✭ 31 (-51.56%)
Mutual labels:  unsafe

SABOTAGE

Build Status GoDoc Go Report

Collection of dirty hacks in Go.

  1. Repeat sync.Once once more.
  2. Check if sync.Mutex/sync.RWMutex is locked.
  3. []byte <-> string conversion without additional allocation.

logo

Cause what you see, you might not get
And we can bet, so don't you get souped yet
Scheming on a thing, that's a mirage
I'm trying to tell you now, it's sabotage

Whhhhhyyyyyy??????

(c) Beastie Boys - Sabotage

Examples

  1. You can repeat sync.Once as much as you want:
var once sync.Once

once.Do(myFunc)

sabotage.ResetSyncOnce(&once) 

or check if it was invoked earlier:

if sabotage.IsOnceDone(&once) {
    println("well-well-well")
}
  1. You can unlock any mutex from anywhere:
var mu sync.Mutex

// let's yolo begins
sabotage.UnlockMutex(&mu)

or check if it's locked:

if sabotage.IsMutexLocked(&mu) {
    for {
        // let's wait a bit
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].