This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ | |
├── cmd | |
├── deployments | |
├── internal | |
├── migrations | |
├── specs | |
├── tests | |
├── go.mod | |
├── go.sum | |
├── Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repos: | |
- repo: https://github.com/golangci/golangci-lint | |
rev: v1.23.7 | |
hooks: | |
- id: golangci-lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run: | |
tests: false | |
# Возможно отключать все линтеры на определенных папках и файлах | |
skip-dirs: | |
- generated | |
skip-files: | |
- ".*easyjson\\.go$" | |
output: | |
print-issued-lines: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Запустить тесты проекта | |
# Перед запуском тестов разворачивается БД и на нее накатываются миграции | |
.PHONY: test | |
test: dev-migrate | |
go test -cover -coverprofile=coverage.out ./... | |
go tool cover -html=coverage.out -o coverage.html | |
# Развернуть все dev окружение | |
.PHONY: dev-server | |
dev-server: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
# Контейнер с dev-версией приложения | |
gift-certificates-dev: | |
container_name: gift-certificates-dev | |
# Инструкция о том что контейнер нужно пересобирать, а не делать pull из docker-репозитория | |
build: | |
context: ../ | |
# В случае если Dockerfile поддерживает multistage, можно указать на каком месте в сборке | |
# нужно остановиться. В этом случае нужно остановиться на этапе сборки бинарного файла, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
DROP SEQUENCE public.ui_users_id_seq; | |
DROP TABLE ui_users; | |
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
CREATE SEQUENCE ui_users_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | |
CREATE TABLE ui_users ( | |
id INT NOT NULL, | |
username VARCHAR(180) NOT NULL, | |
username_canonical VARCHAR(180) NOT NULL, | |
email VARCHAR(180) NOT NULL, | |
email_canonical VARCHAR(180) NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
migrations | |
├── 00001_init.down.sql | |
├── 00001_init.up.sql | |
├── 00002_create_ui_users_table.down.sql | |
├── 00002_create_ui_users_table.up.sql | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM gotools.docker.lamoda.ru/base-mod:1.14.0 as build | |
ENV GOOS linux | |
ENV GOARCH amd64 | |
ENV CGO_ENABLED 0 | |
ENV GO111MODULE on | |
WORKDIR /go/src/stash.lamoda.ru/ecom/discounts.endpoint | |
# We want to populate the module cache based on the go.{mod,sum} files. | |
COPY go.mod . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG version | |
FROM golang:$version | |
ENV GOOS linux | |
ENV GOARCH amd64 | |
ENV CGO_ENABLED 0 | |
ENV GO111MODULE on | |
RUN go get github.com/axw/gocov/gocov && \ | |
go get github.com/AlekSi/gocov-xml@d2f6da892a0d5e0b587526abf51349ad654ade51 && \ |
NewerOlder