Skip to content

Instantly share code, notes, and snippets.

View irwinby's full-sized avatar
☁️
Somewhere in the clouds...

irwin irwinby

☁️
Somewhere in the clouds...
View GitHub Profile
@irwinby
irwinby / main.yaml
Created July 8, 2022 17:06
An example of GitHub Actions for the Go application
name: "[lint, test, build]"
on: [push, pull_request]
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Setup Go environment
@irwinby
irwinby / .golangci.yaml
Created July 8, 2022 17:00
GolangCI config for the Go application
run:
timeout: 3m
go: "1.18"
linters:
disable-all: true
enable:
- deadcode
- depguard
- dogsled
@irwinby
irwinby / .pre-commit-config.yaml
Created July 8, 2022 16:58
pre-commit hooks for the Go application
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-merge-conflict
- repo: local
hooks:
@irwinby
irwinby / Dockerfile
Created July 8, 2022 16:55
Dockerfile template for creating a Docker image for the Go application
FROM --platform=$BUILDPLATFORM golang:1.18-buster as builder
WORKDIR /go/src/github.com/{ORGANIZATION_NAME}/{REPOSITORY_NAME}
COPY go.* .
RUN go mod download
COPY . .