syntax = "proto3";
option go_package = "github.com/Ja7ad/bookstore";
service Greeter {
rpc GetBook(GetBookRequest) returns (Book) {}
rpc AddBook(AddBookRequest) returns (Book) {}
rpc AddManyBook(AddManyBookRequest) returns (google.protobuf.Empty) {}
rpc UpdateBook(UpdateBookRequest) returns (Book) {}
The post Go is not C, so there is not an extreme fast way to merge slices alleges a performance problem with Go's model of zeroing memory on allocation, in cases where it might not be needed. The methodology is
- Run a benchmark that merges some slices, by
make
ing one of the appropriate size and copying the individual slices over - Run a benchmark that zeros a slice of the appropriate slice
- Subtract the two numbers and call it the "overhead of zeroing"
I have some trouble with that methodology. For one, it assumes that the zeroing
This file contains hidden or 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
go func() { | |
for { | |
err = rmq.Stream(cancelCtx) | |
if errors.Is(err, rabbitmq.ErrDisconnected) { | |
continue | |
} | |
break | |
} | |
}() |
This file contains hidden or 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
# using-wget-with-socks-proxy | |
# This should work for everything includeing curl, pip, pipenv, etc | |
# TLDR: Use proxychains (https://github.com/haad/proxychains) | |
## INSTALL PROXY CHAINS ## | |
$ sudo apt update -y | |
$ sudo apt install proxychains | |
## EDIT PROXYCHAINS CONFIG ## |
This file contains hidden or 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 ( | |
"os" | |
"fmt" | |
) | |
func main() { | |
for _, pair := range os.Environ() { | |
fmt.Println(pair) |