Skip to content

Instantly share code, notes, and snippets.


Alexandr Afanasiev pomkine

View GitHub Profile
pomkine / process_csv.go
Created Jul 9, 2020
Node-like csv channeled read
View process_csv.go
func processCSV(rc io.Reader) (ch chan []string) {
ch = make(chan []string, 10)
go func() {
r := csv.NewReader(rc)
if _, err := r.Read(); err != nil { //read header
defer close(ch)
for {
rec, err := r.Read()
pomkine / options.go
Last active Apr 1, 2020
Go functional options
View options.go
type Server struct {
addr string
timeout int
retry int
speed int
func NewServer(addr string, opts ...func(*Server)) (*Server, error) {
srv := new(Server)
srv.addr = addr
pomkine / mux.go
Created Apr 1, 2020
Using Go first class functions with channels
View mux.go
import (
type Mux struct {
ops chan func(map[net.Addr]net.Conn)
func (m *Mux) Add(conn net.Conn) {

Keybase proof

I hereby claim:

  • I am pomkine on github.
  • I am pomkine ( on keybase.
  • I have a public key whose fingerprint is DE8A E80B 9E0A A9A3 8F29 0DA3 980E 73BA 299B 9F27

To claim this, I am signing this object:

You can’t perform that action at this time.