Skip to content

Instantly share code, notes, and snippets.

View rebornwwp's full-sized avatar
😕
Working from home

u rebornwwp

😕
Working from home
View GitHub Profile
@rebornwwp
rebornwwp / ssadump.go
Created December 23, 2021 09:31 — forked from ksurent/ssadump.go
Print Go's SSA form, much like ssadump but with concrete types
package main
import (
"flag"
"fmt"
"go/build"
"go/types"
"os"
"golang.org/x/tools/go/loader"
@rebornwwp
rebornwwp / Makefile
Created October 19, 2020 12:17 — forked from kwilczynski/Makefile
Makefile for my Go projects (an example).
SHELL := /bin/bash
REV := $(shell git rev-parse HEAD)
CHANGES := $(shell test -n "$$(git status --porcelain)" && echo '+CHANGES' || true)
TARGET := packer-provisioner-itamae-local
VERSION := $(shell cat VERSION)
OS := darwin freebsd linux openbsd
ARCH := 386 amd64
@rebornwwp
rebornwwp / signal.go
Created October 17, 2020 12:11 — forked from reiki4040/signal.go
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@rebornwwp
rebornwwp / Makefile
Created September 26, 2020 10:26 — forked from rlespinasse/Makefile
guard-makefile
task-who-need-specific-envvar: guard-SPECIFIC_ENVVAR
@echo ${SPECIFIC_ENVVAR}
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi
# $ make task-who-need-specific-envvar
@rebornwwp
rebornwwp / Makefile
Created July 13, 2020 18:20 — forked from sighingnow/Makefile
Detect operating system in Makefile.
# Detect operating system in Makefile.
# Author: He Tao
# Date: 2015-05-30
OSFLAG :=
ifeq ($(OS),Windows_NT)
OSFLAG += -D WIN32
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
OSFLAG += -D AMD64
endif