From 5448af2fd3fd9a54405480d30fc787b22c5471e2 Mon Sep 17 00:00:00 2001 From: libmartinito Date: Mon, 11 Dec 2023 18:10:49 +0800 Subject: [PATCH] CC-853 updated go starter to be consistent --- compiled_starters/go/go.mod | 11 +++++++++++ compiled_starters/go/go.sum | 0 dockerfiles/go-1.19.Dockerfile | 9 +++++++++ solutions/go/01-init/code/go.mod | 11 +++++++++++ solutions/go/01-init/code/go.sum | 0 starter-repository-definitions.yml | 4 ++++ starter_templates/go/go.mod | 11 +++++++++++ starter_templates/go/go.sum | 0 8 files changed, 46 insertions(+) create mode 100644 compiled_starters/go/go.mod create mode 100644 compiled_starters/go/go.sum create mode 100644 solutions/go/01-init/code/go.mod create mode 100644 solutions/go/01-init/code/go.sum create mode 100644 starter_templates/go/go.mod create mode 100644 starter_templates/go/go.sum diff --git a/compiled_starters/go/go.mod b/compiled_starters/go/go.mod new file mode 100644 index 0000000..039dce6 --- /dev/null +++ b/compiled_starters/go/go.mod @@ -0,0 +1,11 @@ +// DON'T EDIT THIS! +// +// Codecrafters relies on this file being intact to run tests successfully. Any changes +// here will not reflect when CodeCrafters tests your code, and might even cause build +// failures. +// +// DON'T EDIT THIS! + +module github.com/codecrafters-io/docker-starter-go + +go 1.19 diff --git a/compiled_starters/go/go.sum b/compiled_starters/go/go.sum new file mode 100644 index 0000000..e69de29 diff --git a/dockerfiles/go-1.19.Dockerfile b/dockerfiles/go-1.19.Dockerfile index 206b700..f0a7fa6 100644 --- a/dockerfiles/go-1.19.Dockerfile +++ b/dockerfiles/go-1.19.Dockerfile @@ -6,3 +6,12 @@ RUN apk add curl ARG docker_explorer_version=v18 RUN curl --fail -Lo /usr/local/bin/docker-explorer https://github.com/codecrafters-io/docker-explorer/releases/download/${docker_explorer_version}/${docker_explorer_version}_linux_amd64 RUN chmod +x /usr/local/bin/docker-explorer + +ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum" + +WORKDIR /app + +COPY go.mod go.sum ./ + +RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs -r go get + diff --git a/solutions/go/01-init/code/go.mod b/solutions/go/01-init/code/go.mod new file mode 100644 index 0000000..039dce6 --- /dev/null +++ b/solutions/go/01-init/code/go.mod @@ -0,0 +1,11 @@ +// DON'T EDIT THIS! +// +// Codecrafters relies on this file being intact to run tests successfully. Any changes +// here will not reflect when CodeCrafters tests your code, and might even cause build +// failures. +// +// DON'T EDIT THIS! + +module github.com/codecrafters-io/docker-starter-go + +go 1.19 diff --git a/solutions/go/01-init/code/go.sum b/solutions/go/01-init/code/go.sum new file mode 100644 index 0000000..e69de29 diff --git a/starter-repository-definitions.yml b/starter-repository-definitions.yml index c12ebf5..8f23e46 100644 --- a/starter-repository-definitions.yml +++ b/starter-repository-definitions.yml @@ -24,6 +24,10 @@ target: codecrafters.yml - source: starter_templates/go/app/main.go target: app/main.go + - source: starter_templates/go/go.mod + target: go.mod + - source: starter_templates/go/go.sum + target: go.sum - source: starter_templates/go/Dockerfile target: Dockerfile - source: starter_templates/go/your_docker.sh diff --git a/starter_templates/go/go.mod b/starter_templates/go/go.mod new file mode 100644 index 0000000..039dce6 --- /dev/null +++ b/starter_templates/go/go.mod @@ -0,0 +1,11 @@ +// DON'T EDIT THIS! +// +// Codecrafters relies on this file being intact to run tests successfully. Any changes +// here will not reflect when CodeCrafters tests your code, and might even cause build +// failures. +// +// DON'T EDIT THIS! + +module github.com/codecrafters-io/docker-starter-go + +go 1.19 diff --git a/starter_templates/go/go.sum b/starter_templates/go/go.sum new file mode 100644 index 0000000..e69de29