// TODO(as): MAKE XML DOXYGEN THING SO IDE WITH COLORS CAN READ THIS
package main

import (
	"os"
	"sync"

	_ "github.com/mailru/easyjson"
	_ "github.com/satori/go.uuid"
	_ "github.com/valyala/fasthttp"
)

func main() {
	sync.Once(func(){}())

	myMutexLockVariable := struct {
		IDontKnowHowEmbeddingWorks *sync.RWMutex // FOR SCALEABILITY
	}{
		func() *sync.RWMutex {
			return new(sync.RWMutex) // FACTORY PATTERN FACTORY PATTERN!
		}(),
	}
	
	lockthelock := func(){
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock()
	}
	unlockthelock := func(){
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock()
	}
	// TODO(as): THERE THEM FUNCTIORNS NO WORKY ABSTRACTION FOR SOME REASON
	// SO WE JUST CALL myMutexLockVariable.IDontKnowHowEmbeddingWorks FUNCTIONS
	// DIRECTLY THERE IS A BUG INSIDE OF THE GO PROGRAMMING LANGUAGE
	//
	// GO ISSUE NUMBER: 181393
	// Description: GO NO WORKY, I PUT FUNCTORS TO ACCESS MY LOCK AND IT DEAD LOCK
	// cc: bradfitz, ian lance taylor, rob pike, ken, even brian k
	lockthelock = lockthelock
	unlockthelock = unlockthelock
	    // I DONT WANNA DELETE FUNCY BECAUSE I WORK TOO HARD ON THEM WE KEEP IT FOR USE LATER WHEN GO FIXES BUG

	var err error
	if myMutexLockVariable.IDontKnowHowEmbeddingWorks == nil {
		panic("whoops, you forgot to put the pointer of the mutex!!!!!")
		os.Exit(0xbadc0de) // FOR SAFTEY
	}
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.RLock()
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock() // just grease the wheels a bit
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock()
	go func() {
		println("goroutine!")
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock()
	}()

	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock() // WAIT FOR BABY TO FINISH
	if &err != nil {
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock() // DO IT HERE FASTER THAN DEFUR
		main()
		os.Exit(0) // YAY
	}
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock() // DO IT HERE FASTER THAN DEFUR
}

THIS CODE IS COVERED BY THE GNU AFFERO PUBIC LICENSE, DO NOT SHARE THIS CODE WITHOUT PUBLISHING ALL OF YOUR CHANGES. FREE SOFTWARE FREEEEEDOM!!!

TO SEE THE TEXINFO MANUAL IN EMACS, TYPE CONTROL X CLOVER CLOVER DOT 9

By github.com/as, 2019-10-18 19:26:43