data.go
Your code does not pass gofmt in 1 place. Go fmt your code!// > data.go // WARNING DO NOT MANUALLY EDIT - YOUR CHANGES WILL BE OVERRIDDEN// MAKE CHANGES AT ~/app/data/generate AND RUN make generate TO REGENERATE// THE FOLLOWING FILE//// GENERATED BY GO:GENERATE AT 2019-04-01 15:45:20.430980493 +0000 UTC m=+0.006510702//// FILE GENERATED USING ~/app/data/generate.go package main // Version is used by godev for reporting the version when installed via 'go get'const Version = "0.6.2" // Commit is used by godev for reporting the version when installed via 'go get'const Commit = "c787f3f" // DataDockerfile defines the 'Dockerfile' contents when --init is used// hash:fc3c6491cb0d101ae17e2e68aec4714fconst DataDockerfile = `## ## base image - defines the operating system layer for the build## -------------------------------------------------------------## use this to adjust the version of golang you want a build withARG GOLANG_VERSION=1.11.5## use this to adjust the version of alpine to run for the buildARG ALPINE_VERSION=3.9FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} AS base## allow for passing in of any additional packages you might needARG ADDITIONAL_APKS## due diligenceRUN apk update --no-cacheRUN apk upgrade --no-cache## go modules dependenciesRUN apk add --no-cache git## without these ssl/tls will not workRUN apk add --no-cache ca-certificates && update-ca-certificates## other development toolingRUN apk add --no-cache make #### development image - where things are actually built## ---------------------------------------------------FROM base as development## what should we name our binary? (default indicates "app")ARG BIN_NAME=app## any extension we would like for our binary? (default indicates nothing)ARG BIN_EXT## relative path to the binary from the working directoryARG BIN_PATH=bin## which architecture should we build for? (default indicates amd64)ARG GOARCH=amd64## which operating system should we build for? (default indicates linux)ARG GOOS=linux## should we use static linking? (default indicates yes)ARG CGO_ENABLED=0## should we use go modules for the dependencies? (default indicates yes)ARG GO111MODULE=on## use something GOPATH/GOROOT friendly - don't anger the godsWORKDIR /go/src/${BIN_NAME}## process dependencies first to take advantage of docker cachingCOPY ./Makefile ./MakefileCOPY ./go.mod ./go.modCOPY ./go.sum ./go.sumRUN make deps## process everything elseCOPY . /go/src/${BIN_NAME}RUN make compile.linux## generate a hashRUN sha256sum ${BIN_PATH}/${BIN_NAME}-${GOOS}-${GOARCH}${BIN_EXT} | cut -d " " -f 1 > ${BIN_PATH}/${BIN_NAME}-${GOOS}-${GOARCH}${BIN_EXT}.sha256## move things to where they should beRUN mv /go/src/${BIN_NAME}/${BIN_PATH}/${BIN_NAME}-${GOOS}-${GOARCH}${BIN_EXT} /${BIN_NAME}RUN mv /go/src/${BIN_NAME}/${BIN_PATH}/${BIN_NAME}-${GOOS}-${GOARCH}${BIN_EXT}.sha256 /${BIN_NAME}.sha256RUN ln -s /${BIN_NAME} /_RUN chmod +x /_## let it startENTRYPOINT ["/_"] ### production image - the really small image# -----------------------------------------FROM scratch AS production## what should we name our binary? (default indicates "app")ARG BIN_NAME=appWORKDIR /## copy everything over from the development build imageCOPY --from=base /etc/ssl/certs /etc/ssl/certsCOPY --from=development /${BIN_NAME} /${BIN_NAME}COPY --from=development /${BIN_NAME}.sha256 /${BIN_NAME}.sha256COPY --from=development /_ /_## let it startENTRYPOINT ["/_"]## if you're on openshift, you'll need to define this to define your application's ports# EXPOSE 65534 ` // DataMakefile defines the 'Makefile' contents when --init is used// hash:5ae20a94ab0d7cb71f695bdbf916bce9const DataMakefile = `#### Makefile constants - extract to a separate file if needed## ---------------------------------------------------------## specifies the name of your application binaryBIN_NAME=app## specifies the relative path to a directory where the binary should be placed inBIN_PATH=bin## specifies the registry to push toDOCKER_REGISTRY_HOSTNAME=docker.io## specifies docker.io/THIS/image:tagDOCKER_IMAGE_NAMESPACE=godev## specifies docker.io/namespace/THIS:tag - align with $(BIN_NAME) for less confusionDOCKER_IMAGE_NAME=example## specifies the absolute path to the directory containing the .git directoryGIT_ROOT=$(CURDIR)## enable following line to draw variables from a file named Makefile.properties# include Makefile.properties ## starts the application for development with live-reloadstart: @godev## installs the dependencies using go modulesdeps: @go mod vendor## runs the tests with live-reloadtest: @godev --test## compiles binaries for all systemscompile: @$(MAKE) compile.linux @$(MAKE) compile.macos @$(MAKE) compile.windows## compiles binaries for linuxcompile.linux: @$(MAKE) GOARCH=amd64 GOOS=linux .compile## compiles binaries for macoscompile.macos: @$(MAKE) GOARCH=amd64 GOOS=darwin .compile## compiles binaries for windowscompile.windows: @$(MAKE) GOARCH=386 GOOS=windows BIN_EXT=.exe .compile## compilation driver.compile: @CGO_EMABLED=0 GO111MODULE=on \ go build -a -ldflags "-extldflags -static" -o $(CURDIR)/$(BIN_PATH)/$(BIN_NAME)-${GOOS}-${GOARCH}${BIN_EXT} @chmod +x $(CURDIR)/$(BIN_PATH)/$(BIN_NAME)-${GOOS}-${GOARCH}${BIN_EXT} @sha256sum $(CURDIR)/$(BIN_PATH)/$(BIN_NAME)-${GOOS}-${GOARCH}${BIN_EXT} | cut -d " " -f 1 > $(CURDIR)/$(BIN_PATH)/$(BIN_NAME)-${GOOS}-${GOARCH}${BIN_EXT}.sha256## dockerisation for productiondocker: @$(MAKE) .docker STAGE="production"## dockerisation for developmentdocker.dev: @$(MAKE) .docker STAGE="development"## dockerisation driver.docker: @$(MAKE) log.info MSG="creating image $(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):latest" @docker build \ --target ${STAGE} \ --build-arg BIN_NAME=$(BIN_NAME) \ --build-arg BIN_PATH=$(BIN_PATH) \ --target=production \ -t $(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):latest \ .docker.prepare: docker @$(MAKE) log.info MSG="tagging image $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):latest" @docker tag \ $(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):latest \ $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):latest @$(MAKE) log.info MSG="tagging image $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):$$($(MAKE) version.get | grep '[0-9]*\.[0-9]*\.[0-9]*')" @docker tag \ $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):latest \ $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):$$($(MAKE) version.get | grep '[0-9]*\.[0-9]*\.[0-9]*') @$(MAKE) log.info MSG="tagging image $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):$$($(MAKE) version.get | grep '[0-9]*\.[0-9]*\.[0-9]*')-$$(git rev-list -1 HEAD)" @docker tag \ $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):$$($(MAKE) version.get | grep '[0-9]*\.[0-9]*\.[0-9]*') \ $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):$$($(MAKE) version.get | grep '[0-9]*\.[0-9]*\.[0-9]*')-$$(git rev-list -1 HEAD)publish.dockerhub: docker.prepare @$(MAKE) log.info MSG="pushing image $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):latest" @docker push $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):latest @$(MAKE) log.info MSG="pushing image $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):$$($(MAKE) version.get | grep '[0-9]*\.[0-9]*\.[0-9]*')" @docker push $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):$$($(MAKE) version.get | grep '[0-9]*\.[0-9]*\.[0-9]*') @$(MAKE) log.info MSG="pushing image $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):$$($(MAKE) version.get | grep '[0-9]*\.[0-9]*\.[0-9]*')-$$(git rev-list -1 HEAD)" @docker push $(DOCKER_REGISTRY_HOSTNAME)/$(DOCKER_IMAGE_NAMESPACE)/$(DOCKER_IMAGE_NAME):$$($(MAKE) version.get | grep '[0-9]*\.[0-9]*\.[0-9]*')-$$(git rev-list -1 HEAD)version.get: @docker run \ -v "$(GIT_ROOT):/app" \ zephinzer/vtscripts:latest \ get-latest -qversion.next: @docker run \ -v "$(GIT_ROOT):/app" \ zephinzer/vtscripts:latest \ get-next -qversion.bump: @docker run \ -v "$(GIT_ROOT):/app" \ zephinzer/vtscripts:latest \ iterate ${VERSION} -i -qlog.debug: -@printf -- "\033[36m\033[1m_ [DEBUG] ${MSG}\033[0m\n"log.info: -@printf -- "\033[32m\033[1m> [INFO] ${MSG}\033[0m\n"log.warn: -@printf -- "\033[33m\033[1m? [WARN] ${MSG}\033[0m\n"log.error: -@printf -- "\033[31m\033[1m! [ERROR] ${MSG}\033[0m\n" ` // DataDotGitignore defines the '.gitignore' contents when --init is used// hash:3e59a1165602d77a63163af48e9793bcconst DataDotGitignore = `# development artifactsbinc.outvendor ` // DataDotDockerignore defines the '.dockerignore' contents when --init is used// hash:9441e48bcf7b0249fc852973e74053f4const DataDotDockerignore = `.dockerignore.gitignoreDockerfilebinc.outvendor ` // DataMainDotgo defines the '.dockerignore' contents when --init is used// hash:4a73f12d9bde8b278abb6dc558584402const DataMainDotgo = `package main import "fmt" func main() { fmt.Println("hello world!")} ` // DataGoDotMod defines the 'go.mod' contents when --init is used// hash:b6791696ce7f0e334775b206f1fa9deaconst DataGoDotMod = `module app ` // WARNING DO NOT MANUALLY EDIT - YOUR CHANGES WILL BE OVERRIDDEN// MAKE CHANGES AT ~/app/data/generate AND RUN make generate TO REGENERATE// THE FOLLOWING FILE//// GENERATED BY GO:GENERATE AT 2019-04-01 15:45:20.430980493 +0000 UTC m=+0.006510702//// FILE GENERATED USING ~/app/data/generate.go // < data.go