Made Init safer

Init fails if go.mod exists. Removed commands that prevented this.

If go init is to be re-run, then the go.mod needs to be manually
removed, as it should be.
This commit is contained in:
sjc
2021-07-05 10:36:12 -04:00
parent ca8d36393b
commit 54e8548ddf

View File

@@ -40,7 +40,7 @@ FROM base as mod-init-base
WORKDIR /out
COPY . .
ENV MODNAME example
RUN rm -f go.sum go.mod ; go mod init "${MODNAME}" && go mod tidy
RUN go mod init "${MODNAME}" && go mod tidy
FROM base AS mod-tidy
WORKDIR /out