-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from SimonBaeumer/review
Various review fixes
- Loading branch information
Showing
13 changed files
with
57 additions
and
49 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
golang-cli-template | ||
/.idea | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
|
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
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 |
---|---|---|
|
@@ -37,4 +37,3 @@ nfpms: | |
formats: | ||
- deb | ||
- rpm | ||
|
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ A general purpose project template for golang CLI applications | |
|
||
[![Test](https://github.com/FalcoSuessgott/golang-cli-template/actions/workflows/test.yml/badge.svg)](https://github.com/FalcoSuessgott/golang-cli-template/actions/workflows/test.yml) [![golangci-lint](https://github.com/FalcoSuessgott/golang-cli-template/actions/workflows/lint.yml/badge.svg)](https://github.com/FalcoSuessgott/golang-cli-template/actions/workflows/lint.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/FalcoSuessgott/golang-cli-template)](https://goreportcard.com/report/github.com/FalcoSuessgott/golang-cli-template) [![Go Reference](https://pkg.go.dev/badge/github.com/FalcoSuessgott/golang-cli-template.svg)](https://pkg.go.dev/github.com/FalcoSuessgott/golang-cli-template) [![codecov](https://codecov.io/gh/FalcoSuessgott/golang-cli-template/branch/main/graph/badge.svg?token=Y5K4SID71F)](https://codecov.io/gh/FalcoSuessgott/golang-cli-template) | ||
|
||
This template serves as a starting point for golang commandline applications based on the go community default [project-layout](https://github.com/golang-standards/project-layout). | ||
This template serves as a starting point for golang commandline applications it is based on golang projects that I consider high quality and various other useful blog posts that helped me understanding golang better. | ||
|
||
# Features | ||
- [goreleaser](https://goreleaser.com/) with `deb.` and `.rpm` package releasing | ||
|
@@ -21,19 +21,17 @@ This template serves as a starting point for golang commandline applications bas | |
|
||
# How to use this template | ||
```sh | ||
{ | ||
GITHUB_USER="my-github-user" | ||
PROJECT="new-golang-project" | ||
git clone [email protected]:FalcoSuessgott/golang-cli-template.git $PROJECT | ||
cd $PROJECT | ||
git clone [email protected]:FalcoSuessgott/golang-cli-template.git "$PROJECT" | ||
cd "$PROJECT" | ||
rm -rf .git | ||
find . -type f -exec sed -i "s/FalcoSuessgott\/golang-cli-template/$GITHUB_USER\/$PROJECT/g" {} + | ||
make fmt | ||
git init | ||
git add . | ||
git commit -m "initial commit" | ||
git remote add origin [email protected]:$GITHUB_USER/$PROJECT.git | ||
} | ||
git remote add origin "[email protected]:$GITHUB_USER/$PROJECT.git" | ||
``` | ||
|
||
# Demo Application | ||
|
@@ -82,6 +80,10 @@ make fmt | |
make fmtcheck | ||
``` | ||
|
||
## deps | ||
```sh | ||
make deps | ||
``` | ||
## build | ||
```sh | ||
make build | ||
|
@@ -95,4 +97,12 @@ make test | |
## cover | ||
```sh | ||
make cover | ||
``` | ||
``` | ||
|
||
# Contribute | ||
If you find issues in that setup or have some nice features / improvements, I would welcome an issue or a PR :) | ||
|
||
|
||
# Ideas | ||
- [ ] implement a `create` subcommand that preconfigures this project setup and all its dependencies | ||
- [ ] introduce viper config examples |
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/FalcoSuessgott/golang-cli-template/cmd" | ||
) | ||
|
||
func main() { | ||
if err := cmd.Execute(); err != nil { | ||
fmt.Fprintf(os.Stderr, "%v", err) | ||
os.Exit(1) | ||
} | ||
} |