From 219de2b99752e5c1002b3fccd570f3e3dd509d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20W=C3=BCstenberg?= Date: Tue, 19 Nov 2024 09:50:18 +0100 Subject: [PATCH] Initial commit --- .editorconfig | 15 ++++++++++++ .github/dependabot.yml | 10 ++++++++ .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + LICENSE | 21 ++++++++++++++++ Makefile | 16 ++++++++++++ README.md | 7 ++++++ go.mod | 3 +++ template.go | 1 + 9 files changed, 127 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 go.mod create mode 100644 template.go diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5017192 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[Makefile] +indent_style = tab + +[{*.go,*.md}] +indent_style = tab diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c507d44 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..233b690 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + check-latest: true + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v -coverprofile=cover.out -shuffle on ./... + + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + check-latest: true + + - name: Lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eae9097 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/cover.out diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4ea9178 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Maragu ApS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..67a1e22 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +.PHONY: benchmark +benchmark: + go test -bench=. + +.PHONY: cover +cover: + go tool cover -html=cover.out + +.PHONY: lint +lint: + golangci-lint run + +.PHONY: test +test: + go test -coverprofile=cover.out -shuffle on ./... + diff --git a/README.md b/README.md new file mode 100644 index 0000000..6581e92 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# template + +[![Go](https://github.com/maragudk/template/actions/workflows/ci.yml/badge.svg)](https://github.com/maragudk/template/actions/workflows/ci.yml) + +Made with ✨sparkles✨ by [maragu](https://www.maragu.dev/). + +Does your company depend on this project? [Contact me at markus@maragu.dk](mailto:markus@maragu.dk?Subject=Supporting%20your%20project) to discuss options for a one-time or recurring invoice to ensure its continued thriving. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..16b396b --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module template + +go 1.23 diff --git a/template.go b/template.go new file mode 100644 index 0000000..38cdfe4 --- /dev/null +++ b/template.go @@ -0,0 +1 @@ +package template