chore(go): update project for go 1.16 (modules, etc)

This commit is contained in:
2021-04-14 19:37:54 +01:00
parent 93589c3261
commit ee6700367f
40 changed files with 44 additions and 9040 deletions

View File

@@ -1,18 +1,14 @@
FROM golang:1.10-alpine as builder
RUN set -e \
&& apk add --no-cache git \
&& wget -O - https://github.com/golang/dep/raw/master/install.sh | sh
WORKDIR /go/src/github.com/jimeh/casecmp
ADD . /go/src/github.com/jimeh/casecmp
RUN set -e \
&& dep ensure \
&& CGO_ENABLED=0 go build -a -o /casecmp \
-ldflags "-s -w \
-X main.version=$(cat VERSION) \
-X main.commit=$(git show --format='%h' --no-patch)\
-X main.date=$(date +%Y-%m-%dT%T%z)"
FROM golang:1.16-alpine as builder
RUN apk add --no-cache \
git
WORKDIR /app
COPY . /app
RUN env CGO_ENABLED=0 \
go build -a -o /casecmp -ldflags "-s -w \
-X main.version=$(cat VERSION) \
-X main.commit=$(git show --format='%h' --no-patch) \
-X main.date=$(date +%Y-%m-%dT%T%z)"
FROM scratch
COPY --from=builder /casecmp /