Skip to content

Instantly share code, notes, and snippets.

View uloureiro's full-sized avatar

Urick Loureiro uloureiro

View GitHub Profile
@uloureiro
uloureiro / mutation_pattern.go
Last active February 8, 2022 15:27
Mutation pattern in Go
package main
import (
"fmt"
)
// This mutation pattern allows mutating an object without having to instantiate
// it first. This is specially useful in tests where you need to do small changes
// in the object's state based on a default initializtion value.
@uloureiro
uloureiro / awesome-go-articles.md
Last active April 11, 2023 14:20
Awesome Go Articles
@uloureiro
uloureiro / run_and_debug_vscode_golang.md
Created July 9, 2021 18:33
[Run and Debug in VSCode] #golang
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run and Debug",
            "type": "go",
            "request": "launch",
            "mode": "debug",
 "program": "${workspaceFolder}/cmd/server/main.go", // the path of your starting point
@uloureiro
uloureiro / dataset_channels.go
Created March 24, 2021 16:47
Data Set and Concurrency in Go with Channels
// https://play.golang.org/p/b7lYcShM2kC
package main
import (
"fmt"
"sync"
)
type Set struct {
values map[int]interface{}
@uloureiro
uloureiro / slices-maps-concurrency.go
Last active March 10, 2021 02:14
Slices and maps and concurrency in Go
// https://play.golang.org/p/L8MVDTGHqhi
package main
import (
"fmt"
"sync"
)
func main() {
feedIP([]string{"255.255.255.0", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "255.255.255.0", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.16

Keybase proof

I hereby claim:

  • I am uloureiro on github.
  • I am urick (https://keybase.io/urick) on keybase.
  • I have a public key ASDvOPiGaJInNILbvR_4BqTqdv_NUzPqWllS2FELTUCrAgo

To claim this, I am signing this object: