generated from atomicgo/template
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit babd772
Showing
14 changed files
with
317 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
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
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 |
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
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 |
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
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 |
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
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 |
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
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.
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
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. |
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
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) · | ||
> with ❤️ by [@MarvinJWendt](https://github.com/MarvinJWendt) | | ||
> [MarvinJWendt.com](https://marvinjwendt.com) |
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
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/atomicgo/template | ||
|
||
go 1.15 |
Empty file.
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
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!" | ||
} |
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
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") | ||
} | ||
} |