Go language snippets
- logger : simply concurrent logger made using
sync
andio
packages - hashtable : a hashtable made in golang
- graphql example
- patterns:
- Creational
- builder
- factory
- singleton
- Messaging
- fan out 3.Structural
- decorator
- Creational
- prepend : because it didn't exist let's add it 😂
- broadcast : one event to multiples channels
- detectClosedChannel : detect if a channel is closed, and we can write to it
- slice tricks with experimental packages
- What is happening if we use a slice like parameters in a function, sending it by value? It will be changed? The response is here https://github.com/doITmagic/go-snippets/blob/main/canGenerateBugs/sliceByValue/sliceByValue.md
- Slices package
- one function slices.SameUnderlying(...) that test if two slices (any types) have the same underlying array using generics
Explanation here https://github.com/doITmagic/go-snippets/wiki/create-slice-from-nothing - slices.IsSubsetOf(...) that test if a slice is a subset of another slice using generics
- one function slices.SameUnderlying(...) that test if two slices (any types) have the same underlying array using generics