Skip to content

Instantly share code, notes, and snippets.

# apiVersion and kind of Kustomization
# apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# Adds namespace to all resources.
# namespace: my-namespace
# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
@pannpers
pannpers / golang-tips.go
Created March 9, 2019 06:36
Tips & Technics of Golang.
// Seek whence values.
//
// Deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.
const (
SEEK_SET int = 0 // seek relative to the origin of the file
SEEK_CUR int = 1 // seek relative to the current offset
SEEK_END int = 2 // seek relative to the end
)
@pannpers
pannpers / go-error-handling.go
Last active March 2, 2019 07:54
Write snippet of error handling for Go
import "github.com/pkg/errors"
func someFunc() error {
pem, err := ioutil.ReadFile(caPath)
if err != nil {
return errors.Errorf("open %s: %v", caPath, err)
}
}