Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed Apr 11, 2021
0 parents commit babd772
Show file tree
Hide file tree
Showing 14 changed files with 317 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
_extends: .github

repository:
# See https://developer.github.com/v3/repos/#edit for all available settings.

# A short description of the repository that will show up on GitHub
description: 🔹 Golang module

# A comma-separated list of topics to set on the repository
topics: atomicgo, go, golang, golang-library

# Either `true` to make the repository private, or `false` to make it public.
# private: false

# Either `true` to enable issues for this repository, `false` to disable them.
# has_issues: true

# Either `true` to enable projects for this repository, or `false` to disable them.
# If projects are disabled for the organization, passing `true` will cause an API error.
# has_projects: false

# Either `true` to enable the wiki for this repository, `false` to disable it.
# has_wiki: false
13 changes: 13 additions & 0 deletions .github/workflows/atomicgo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on: push

name: AtomicGo
jobs:
docs:
if: "!contains(github.event.head_commit.message, 'autoupdate')"
runs-on: ubuntu-latest
steps:
- name: Update Docs
uses: atomicgo/ci@main
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
TERM: xterm-256color
36 changes: 36 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Go

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: go get -v -t -d ./...

- name: Build
run: go build -v .

- name: Test
run: go test -coverprofile="coverage.txt" -covermode=atomic -v -p 1 .

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
13 changes: 13 additions & 0 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: golangci-lint
on: [ push, pull_request ]
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.39
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
### Go template
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
vendor/

### IntelliJ
.idea
*.iml
out
gen

### VisualStudioCode
.vscode
*.code-workspace

### macOS
# General
.DS_Store
71 changes: 71 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
linters-settings:
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
- exitAfterDefer
- hugeParam
- ptrToRefParam
- paramTypeCombine
- unnamedResult
misspell:
locale: US
linters:
disable-all: true
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- asciicheck
- bodyclose
- dupl
- durationcheck
- errorlint
- exhaustive
- gci
- gocognit
- gocritic
- godot
- godox
- goerr113
- gofmt
- goimports
- goprintffuncname
- misspell
- nilerr
- nlreturn
- noctx
- prealloc
- predeclared
- thelper
- unconvert
- unparam
- wastedassign
- wrapcheck
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- errcheck
- dupl
- gocritic
- wrapcheck
- goerr113
# https://github.com/go-critic/go-critic/issues/926
- linters:
- gocritic
text: "unnecessaryDefer:"
service:
golangci-lint-version: 1.39.x # use the fixed version to not introduce new linters unexpectedly
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Marvin Wendt (MarvinJWendt)

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.
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<h1 align="center">AtomicGo | template</h1>

<p align="center">

<a href="https://github.com/atomicgo/template/releases">
<img src="https://img.shields.io/github/v/release/atomicgo/template?style=flat-square" alt="Latest Release">
</a>

<a href="https://codecov.io/gh/atomicgo/template" target="_blank">
<img src="https://img.shields.io/github/workflow/status/atomicgo/template/Go?label=tests&style=flat-square" alt="Tests">
</a>

<a href="https://codecov.io/gh/atomicgo/template" target="_blank">
<img src="https://img.shields.io/codecov/c/gh/atomicgo/template?color=magenta&logo=codecov&style=flat-square" alt="Coverage">
</a>

<a href="https://codecov.io/gh/atomicgo/template">
<!-- unittestcount:start --><img src="https://img.shields.io/badge/Unit_Tests-1-magenta?style=flat-square" alt="Unit test count"><!-- unittestcount:end -->
</a>

<a href="https://github.com/atomicgo/template/issues">
<img src="https://img.shields.io/github/issues/atomicgo/template.svg?style=flat-square" alt="Issues">
</a>

<a href="https://opensource.org/licenses/MIT" target="_blank">
<img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="License: MIT">
</a>

</p>

---

<p align="center">
<strong><a href="#install">Get The Module</a></strong>
|
<strong><a href="https://pkg.go.dev/github.com/atomicgo/template" target="_blank">Documentation</a></strong>
|
<strong><a href="https://github.com/atomicgo/atomicgo/blob/main/CONTRIBUTING.md" target="_blank">Contributing</a></strong>
|
<strong><a href="https://github.com/atomicgo/atomicgo/blob/main/CODE_OF_CONDUCT.md" target="_blank">Code of Conduct</a></strong>
</p>

---

<p align="center">
<img src="https://raw.githubusercontent.com/atomicgo/atomicgo/main/assets/header.png" alt="AtomicGo">
</p>

## Description

Package template is used to generate new AtomicGo repositories.

Write the description of the module here. You can use **markdown**! This
description should clearly explain what the package does.

Example description: https://golang.org/src/encoding/gob/doc.go

## Install

```console
# Execute this command inside your project
go get -u github.com/atomicgo/template
```

```go
// Add this to your imports
import "github.com/atomicgo/template"
```

## Usage

#### func HelloWorld

```go
func HelloWorld() string
```
HelloWorld returns `Hello, World!`.

---

> [AtomicGo.dev](https://atomicgo.dev) &nbsp;&middot;&nbsp;
> with ❤️ by [@MarvinJWendt](https://github.com/MarvinJWendt) |
> [MarvinJWendt.com](https://marvinjwendt.com)
9 changes: 9 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
Package template is used to generate new AtomicGo repositories.
Write the description of the module here. You can use **markdown**!
This description should clearly explain what the package does.
Example description: https://golang.org/src/encoding/gob/doc.go
*/
package template
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/atomicgo/template

go 1.15
Empty file added go.sum
Empty file.
6 changes: 6 additions & 0 deletions template.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package template

// HelloWorld returns `Hello, World!`.
func HelloWorld() string {
return "Hello, World!"
}
9 changes: 9 additions & 0 deletions template_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package template

import "testing"

func TestHelloWorld(t *testing.T) {
if HelloWorld() != "Hello, World!" {
t.Fatal("Not equal")
}
}

0 comments on commit babd772

Please sign in to comment.