Skip to content

Instantly share code, notes, and snippets.

Avatar
😷
limited availability

James Bardin jbardin

😷
limited availability
  • HashiCorp
  • Boston, MA
View GitHub Profile
View vet_diags.go
package main
import (
"fmt"
"go/ast"
"go/token"
"go/types"
"strings"
"golang.org/x/tools/go/analysis"
View keybase.md

Keybase proof

I hereby claim:

  • I am jbardin on github.
  • I am jbardin (https://keybase.io/jbardin) on keybase.
  • I have a public key ASC2kvwv-QPaoxd8n3jhpt5kkrujZvjjwdH3Pr5o5Zttggo

To claim this, I am signing this object:

@jbardin
jbardin / proxy_copy.go
Last active Jun 1, 2021
Go TCP Proxy pattern
View proxy_copy.go
package proxy
import (
"io"
"log"
"net"
)
func Proxy(srvConn, cliConn *net.TCPConn) {
// channels to wait on the close event for each connection
View gist:5bc0407d1f70dfc60269
package main
import (
"log"
"net"
"os"
"os/user"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh/agent"
View utils.go
// Misc Go helper functions
// most "borrowed" from Michael T. Jones
//
// Math utilities
//
// Greatest Common Divisor computed by Euclid's algorithm
func GCD(a, b int) int {
for b != 0 {
View nettimeout
package nettimeout
import (
"net"
"time"
)
// Listener wraps a net.Listener, and gives a place to store the timeout
// parameters. On Accept, it will wrap the net.Conn with our own Conn for us.
type Listener struct {