Skip to content

Instantly share code, notes, and snippets.

View vcabbage's full-sized avatar

Kale Blankenship vcabbage

View GitHub Profile
package test1
func f1() {}
@vcabbage
vcabbage / Dockerfile.build
Created December 18, 2017 21:21
OpenCV Static
FROM golang:1.9-alpine3.6
RUN apk add --update alpine-sdk cmake linux-headers
# Use an ARG to make it easier to test different versions
ARG OPENCV_VERSION=3.2.0
# Download OpenCV
# Build OpenCV statically and without features we don't use
RUN mkdir -p /opencv && \
cd ~/golang/src
GOROOT_BOOTSTRAP=$(go env GOROOT) ./make.bash
~/golang/bin/go test image/gif # replace with package/file to test
@vcabbage
vcabbage / Dockerfile
Last active November 21, 2018 20:06
Multi-stage Dockerfile
FROM golang:alpine AS build
ADD . /go/src/github.com/my/project
WORKDIR /go/src/github.com/my/project
RUN go build -o /mybinary ./cmd/mybinary
FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=build /mybinary /mybinary
ENTRYPOINT ["/mybinary"]
package main
import (
"fmt"
"unsafe"
)
// sliceHeader is the in memory structure of a slice
type sliceHeader struct {
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"
"golang.org/x/sync/singleflight"
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"
"golang.org/x/sync/singleflight"
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"
"golang.org/x/sync/singleflight"
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"
"golang.org/x/sync/singleflight"
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"
)