Skip to content

Instantly share code, notes, and snippets.

View anitgandhi's full-sized avatar

Anit Gandhi anitgandhi

View GitHub Profile
@anitgandhi
anitgandhi / pemerr.go
Last active May 19, 2020 22:22
A drop-in replacement for the Go pem package that can also error if there's an invalid block - https://github.com/golang/go/issues/34069
// Package pemerr is a modified version of the stdlib pem package that adds an additional
// Decode function to support error handling.
// It is otherwise a drop-in replacement.
package pemerr
import (
"bytes"
"encoding/base64"
"encoding/pem"
"errors"

Keybase proof

I hereby claim:

  • I am anitgandhi on github.
  • I am anitgandhi (https://keybase.io/anitgandhi) on keybase.
  • I have a public key whose fingerprint is E188 C296 1E6F 4437 D499 786C C10B 6C0E 7A77 9B90

To claim this, I am signing this object: