Skip to content

Instantly share code, notes, and snippets.

View Peltoche's full-sized avatar
💭
Doing new stuff...

Pierre Peltier Peltoche

💭
Doing new stuff...
  • Paris
  • 04:33 (UTC +02:00)
View GitHub Profile
@Peltoche
Peltoche / dual-stack-ip-test.go
Created May 3, 2023 08:29
A test to see if we can listen on IPv4 and IPv6 on the same port
package main
import (
"fmt"
"net/http"
"time"
"github.com/labstack/echo/v4"
)
@Peltoche
Peltoche / go_1.13_error_migration.bash
Last active September 19, 2022 09:48
Go 1.13 error format migration script
#!/bin/bash
FILES=$@
echo "Migrate: $FILES"
sed -i "s/errors.Wrapf(\(.*\), \"\(.*\)\", \(.*\))/fmt.Errorf(\"\2: %w\", \3, \1)/g" $FILES
sed -i "s/errors.Wrap(\(.*\), \"\(.*\)\")/fmt.Errorf(\"\2: %w\", \1)/g" $FILES
sed -i "s/errors.New(\"\(.*\)\")/fmt.Errorf(\"\1\")/g" $FILES
sed -i "s/errors.Errorf/fmt.Errorf/g" $FILES

Keybase proof

I hereby claim:

  • I am peltoche on github.
  • I am peltoche (https://keybase.io/peltoche) on keybase.
  • I have a public key ASCLxhP9PXbT9qtt3ekqyJErGAkfqe72mKJZmQgp7reMnwo

To claim this, I am signing this object: