https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
{
"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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://play.golang.org/p/b7lYcShM2kC | |
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type Set struct { | |
values map[int]interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
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: